Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#21983 closed defect (bug) (invalid)

Sitemap xml feed from plugin is shown but 404 header added by WordPress if site has no posts

Reported by: Ov3rfly Owned by:
Priority: normal Milestone:
Component: General Version: 3.4.2
Severity: normal Keywords:
Cc: Focuses:

Description

Installed a new site with only pages, no posts.

Also installed the WordPress Sitemap Generator Plugin with a modified template for the pages.

Testing example.com/sitemap.xml in browser showed the xml with all the pages, all seemed fine.

But then Google Webmaster Tools complained about a 404 not found for the /sitemap.xml url.

Some testing showed that WordPress adds a 404 header to all feeds, including the sitemap xml feed, if no posts exist in the website.

Using a work-aound for now, details here, but would like to know this behaviour is to be considered as a bug.

Change History (2)

#1 @markoheijnen
14 years ago

  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

The error is correct and the plugin doesn't deal with all cases. The reason is that the main query still tries to get all the posts and when there aren't one it will show a 404.

I guess it is better to use something like http://wordpress.org/extend/plugins/google-sitemap-generator/ and then the beta.

#2 @Ov3rfly
12 years ago

Finally fixed with [29216]

Same as #18505

Note: See TracTickets for help on using tickets.