Make WordPress Core

Opened 22 months ago

Last modified 15 months 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: Embeds 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 (1)

#1 @swissspidy
15 months ago

See also #35567 for supporting embeds for other object types

Note: See TracTickets for help on using tickets.