Make WordPress Core

Opened 4 years ago

Closed 11 days ago

#37996 closed defect (bug) (maybelater)

Unnecessary rewrite rules added for the /embed endpoint

Reported by: johnbillion Owned by:
Milestone: 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 (3)

#1 @swissspidy
4 years ago

See also #35567 for supporting embeds for other object types

#2 @johnbillion
7 months ago

  • Component changed from Embeds to Rewrite Rules

#3 @johnbillion
11 days ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.