[wp-trac] [WordPress Trac] #37051: New filter `wp_page_path_sql`

WordPress Trac noreply at wordpress.org
Thu Sep 25 14:14:42 UTC 2025


#37051: New filter `wp_page_path_sql`
-------------------------------+----------------------
 Reporter:  sebastian.pisula   |       Owner:  (none)
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  wontfix
 Keywords:  has-patch          |     Focuses:
-------------------------------+----------------------
Changes (by SirLouen):

 * status:  new => closed
 * resolution:   => wontfix
 * milestone:  Awaiting Review =>


Comment:

 @sebastianpisula it's extremely rare to add a filter to alter an SQL
 query. We should not be adding filters just anywhere because, apart from
 the fact that they are too dense for the code, they generate extra
 unnecessary overhead.

 You have here multiple options. You can manipulate the query directly with
 the `query` filter, which simply works.

 Also consider that if you use a language taxonomy, adapt the JOIN to
 `term_relationships` or `term_taxonomy` instead of `postmeta` to leverage
 better indexes.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37051#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list