Make WordPress Core

Opened 4 years ago

Last modified 4 weeks ago

#37996 new defect (bug)

Unnecessary rewrite rules added for the /embed endpoint

Reported by: johnbillion Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version: 4.4
Component: Rewrite Rules Keywords: needs-patch
Focuses: Cc:


WordPress appends /embed to a bunch of rewrite rules that it shouldn't. By default, the following rewrite rules are present on every site but are not valid:

  • category/(.+?)/embed/?$
  • tag/([^/]+)/embed/?$
  • type/([^/]+)/embed/?$
  • comments/embed/?$
  • search/(.+)/embed/?$
  • author/([^/]+)/embed/?$
  • ([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/embed/?$
  • ([0-9]{4})/([0-9]{1,2})/embed/?$
  • ([0-9]{4})/embed/?$
  • [0-9]{4}/[0-9]{1,2}/[^/]+/([^/]+)/embed/?$

These are generated in WP_Rewrite::generate_rewrite_rules().

Related: #35067

Change History (2)

#1 @swissspidy
3 years ago

See also #35567 for supporting embeds for other object types

#2 @johnbillion
4 weeks ago

  • Component changed from Embeds to Rewrite Rules
Note: See TracTickets for help on using tickets.