[wp-trac] [WordPress Trac] #56883: Feeds of non-existent tags and categories displays an empty feed instead of 404

WordPress Trac noreply at wordpress.org
Mon Apr 15 14:41:31 UTC 2024


#56883: Feeds of non-existent tags and categories displays an empty feed instead of
404
--------------------------+------------------------------------
 Reporter:  rafaucau      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Feeds         |     Version:  6.0.3
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  template, performance
--------------------------+------------------------------------

Comment (by karl94):

 Yeah, I think non-existing feed should return 404 too.

 This doesn't happen just on tag or categories feeds, but on every archive
 feed or even comment feeds.

 I did a bit of digging and it seems the inhibition of 404 on feeds started
 in https://core.trac.wordpress.org/ticket/18505
 There the reported issue was: empty but valid archives (e.g. existing tag
 but with no post) have feeds with 404.

 I think feeds should behave as their HTML web counterpart:

  - empty tag/category/term/author/post_type archive => empty webpage/feed
  - non-existing tag/category/term/author/post_type archive => 404 on both
 webpage and feed
  - home with no posts => empty webpage/feed
  - comment feed for non-existing post => 404

 While currently they seem to never trigger a 404.

 @SergeyBiryukov are you willing to accept a patch that goes in this
 direction? I think it would be just a change in
 [https://github.com/WordPress/wordpress-develop/blob/6.5/src/wp-includes
 /class-wp.php#L783 WP::handle_404()] plus some unit tests.

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


More information about the wp-trac mailing list