XML Sitemap & Google News feeds

XML Sitemap & Google News feeds

Install now

Download Version 4.7.4

Requires WordPress: 3.2 or higher
Compatible up to: 4.5.4
Downloads: 766719

Rating: 4 out of 5 stars
# Votes: 31

This plugin dynamically creates feeds that comply with the XML Sitemap and the Google News Sitemap protocol. Multisite, Polylang and WPML compatible and there are no files created. Options can be found on Settings > Reading to control which sitemaps, which post and taxonomy types are included, how priority is calculated, who to ping and set additional robots.txt rules.

The main advantage of this plugin over other XML Sitemap plugins is simplicity. No need to change file or folder permissions, move files or spend time tweaking difficult plugin options.

You, or site owners on your Multisite network, will not be bothered with overly complicated settings like most other XML Sitemap plugins. The default settings will suffice in most cases and XML sitemap values like ChangeFreq and URL Priority are auto-calculated based on post age and comment activity.

An XML Sitemap Index becomes instantly available on yourblog.url/sitemap.xml (or yourblog.url/?feed=sitemap if you’re not using a ‘fancy’ permalink structure) containing references to posts and pages by default, ready for indexing by search engines like Google, Bing, Yahoo, AOL and Ask. When the Google News Sitemap is activated, it will become available on yourblog.url/sitemap-news.xml (or yourblog.url/?feed=sitemap-news), ready for indexing by Google News. Both are automatically referenced in the dynamically created robots.txt on yourblog.url/robots.txt to tell search engines where to find your XML Sitemaps. Google and Bing can be pinged on each new publication.

Please read the FAQ’s for info on how to get your articles listed on Google News.

Compatible with caching plugins like WP Super Cache, W3 Total Cache and Quick Cache that cache feeds, allowing a faster serving to the impatient (when hungry) spider.

NOTES:

  1. If you do not use fancy URL’s or you have WordPress installed in a subdirectory, a dynamic robots.txt will NOT be generated. You’ll have to create your own and upload it to your site root! See FAQ’s.

  2. On large sites, it is advised to use a good caching plugin like WP Super Cache, Quick Cache or W3 Total Cache to improve your site and sitemap performance.

Features

XML Sitemap

  • Sitemap Index with optional inclusion of sitemaps for post types, categories and tags.
  • Sitemap with custom URLs optional.
  • Custom/static sitemaps can be added to the index.
  • Completely automatic post URL priority and change frequency calculation based on post age and comment and trackback activity.
  • Works out-of-the-box, even on Multisite installations.
  • Optionally include Image tags with caption and title for featured images or attached images.
  • Pings Google, Bing & Yahoo, Yandex and Baidu on new post publication.
  • Options to define which post types and taxonomies get included in the sitemap and automatic priority calculation rules.
  • Set priority per post.
  • Exclude individual posts or pages.

Google News Sitemap

  • Optionally include Image tags with caption and title for featured images or attached images.
  • Options to: set a different News Publication Name, include custom post types or limit inclusion to certain post categories.
  • Configure , and tags both globally and post by post
  • Pings Google on new publications.

More

  • Compatible with multi-lingual sites using Polylang or WPML to allow all languages to be indexed equally.
  • Option to add new robots.txt rules. These can be used to further control (read: limit) the indexation of various parts of your site and subsequent spread of pagerank accross your sites pages.
  • Includes XLS stylesheets for human readable sitemaps.

Translations

New transtations will be accepted and listed here. See translation instructions under Other Notes.

Credits

XML Sitemap Feed was originally based on the discontinued plugin Standard XML Sitemap Generator by Patrick Chia. Since then, it has been completely rewritten and extended in many ways.

Commercial message:

Screenshots

  1. xml-sitemap-feed screenshot 1

    XML Sitemap feed viewed in a normal browser. For your eyes only 😉

  2. xml-sitemap-feed screenshot 2

    XML Sitemap source as read by search engines.

Frequently Asked Questions

Where are the options?
See the XML Sitemaps section on Settings > Reading.
How do I get my latest articles listed on Google News?
Go to Suggest News Content for Google News and submit your website info as detailed as possible there. Give them the URL(s) of your fresh new Google News Sitemap in the text field ‘Other’ at the bottom.

You will also want to add the sitemap to your Google Webmasters Tools account to check its validity and performance. Create an account if you don’t have one yet.

My Google News Sitemap is empty!
The rules of the Google News game are that you do not feed the monster any stale food. Older than 2 days is bad. You need to whip up some fresh chow 😉
Can I manipulate values for priority and changefreq?
Yes. You can find default settings for priority, changefreq and lastmod on Settings > Reading. A fixed priority can be set on a post by post basis too.
Do I need to submit the sitemap to search engines?
No. In normal circumstances, your site will be indexed by the major search engines before you know it. The search engines will be looking for a robots.txt file and (with this plugin activated) find a pointer in it to the XML Sitemap on your blog. The search engines will return on a regular basis to see if your site has updates.

Besides that, Google and Bing are pinged upon each new publication.

NOTE: If you have a server without rewrite rules, use your blog without fancy URLs (meaning, you have WordPress Permalinks set to the old default value) or have it installed in a subdirectory, then read Do I need to change my robots.txt for more instructions.

Does this plugin ping search engines?
Yes, Google and Bing are pinged upon each new publication. Unless you disable this feature on Settings > Reading.
Do I need to change my robots.txt?
That depends. In normal circumstances, if you have no physical robots.txt file in your site root, the new sitemap url will be automatically added to the dynamic robots.txt that is generated by WordPress. But in some cases this might not be the case.

If you use a static robots.txt file in your website root, you will need to open it in a text editor. If there is already a line with Sitemap: http://yourblogurl.tld/sitemap.xml you can just leave it like it is. But if there is no sitemap referrence there, add it (adapted to your site url) to make search engines find your XML Sitemap.

Or if you have WP installed in a subdirectory, on a server without rewrite_rules or if you do not use fancy URLs in your Permalink structure settings. In these cases, WordPress will need a little help in getting ready for XML Sitemap indexing. Read on in the WordPress section for more.

My WordPress powered blog is installed in a subdirectory. Does that change anything?
That depends on where the index.php and .htaccess of your installation reside. If they are in the root while the rest of the WP files are installed in a subdir, so the site is accessible from your domain root, you do not have to do anything. It should work out of the box. But if the index.php is together with your wp-config.php and all other WP files in a subdir, meaning your blog is only accessible via that subdir, you need to manage your own robots.txt file in your domain root. It has to be in the root (!) and needs a line starting with Sitemap: followed by the full URL to the sitemap feed provided by XML Sitemap Feed plugin. Like:

Sitemap: http://yourblogurl.tld/subdir/sitemap.xml

If you already have a robots.txt file with another Sitemap reference like it, just add the full line below or above it.

Do I need to use a fancy Permalink structure?
No. While I would advise you to use any one of the nicer Permalink structures for better indexing, you might not be able to (or don’t want to) do that. If so, you can still use this plugin:

Check to see if the URL yourblog.url/?feed=sitemap does produce a feed. Now manually upload your own robots.txt file to your website root containing:

Sitemap: http://yourblog.url/?feed=sitemap

User-agent: *
Allow: /

You can also choose to notify major search engines of your new XML sitemap manually. Start with getting a Google Webmasters Tools account and submit your sitemap for the first time from there to enable tracking of sitemap downloads by Google! or head over to XML-Sitemaps.com and enter your sites sitemap URL.

Can I change the sitemap name/URL?
No. If you have fancy URL’s turned ON in WordPress (Permalinks), the sitemap url that you manually submit to Google (if you are impatient) should be yourblogurl.tld/sitemap.xml but if you have the Permalinks’ Default option set the feed is only available via yourblog.url/?feed=sitemap.
Where can I customize the xml output?
You may edit the XML output in xml-sitemap-feed/feed-sitemap.php but be careful not to break Sitemap protocol compliance. Read more on Sitemaps XML format.

The stylesheet (to make the sitemap human readable) can be edited in xml-sitemap-feed/sitemap.xsl.php.

Note: your modifications will be overwritten upon the next plugin upgrade!

I see no sitemap.xml file in my site root!
There is no actual file created. The sitemap is dynamically generated just like a feed.
I see a sitemap.xml file in site root but it does not seem to get updated!
You are most likely looking at a sitemap.xml file that has been created by another XML Sitemap plugin before you started using this one. Remove that file and let the plugin dynamically generate it just like a feed. There will not be any actual files created.

If that’s not the case, you are probably using a caching plugin or your browser does not update to the latest feed output. Please verify.

I use a caching plugin but the sitemap is not cached
Some caching plugins have the option to switch on/off caching of feeds. Make sure it is turned on.

Frederick Townes, developer of W3 Total Cache, says: “There’s a checkbox option on the page cache settings tab to cache feeds. They will expire according to the expires field value on the browser cache setting for HTML.”

The Google News sitemap is designed to NOT be cached.

I get an ERROR when opening the sitemap or robots.txt!
The absolute first thing you need to check is your blogs privacy settings. Go to Settings > Privacy and make sure you are allowing search engines to index your site. If they are blocked, your sitemap will not be available.

Then, you might want to make sure that there is at least ONE post published. WordPress is known to send 404 status headers with feed requests when there are NO posts. Even though the plugin tries to prevent that, in some cases the wrong status header will get sent anyway and Google Webmaster Tools will report a vague message like:

We encountered an error while trying to access your Sitemap.
Please ensure your Sitemap follows our guidelines and can be
accessed at the location you provided and then resubmit.

If that did not solve the issue, check the following errors that might be encountered along with their respective solutions:

404 page instead of my sitemap.xml

Try to refresh the Permalink structure in WordPress. Go to Settings > Permalinks and re-save them. Then reload the XML Sitemap in your browser with a clean browser cache. ( Try Ctrl+R to bypass the browser cache — this works on most but not all browsers. )

404 page instead of both sitemap.xml and robots.txt

There are plugins like Event Calendar (at least v.3.2.beta2) known to mess with rewrite rules, causing problems with WordPress internal feeds and robots.txt generation and thus conflict with the XML Sitemap Feed plugin. Deactivate all plugins and see if you get a basic robots.txt file showing:

User-agent: *
Disallow:

Reactivate your plugins one by one to find out which one is causing the problem. Then report the bug to the plugin developer.

404 page instead of robots.txt while sitemap.xml works fine

There is a know issue with WordPress (at least up to 2.8) not generating a robots.txt when there are no posts with published status. If you use WordPress as a CMS with only pages, this will affect you.

To get around this, you might either at least write one post and give it Private status or alternatively create your own robots.txt file containing:

Sitemap: http://yourblog.url/sitemap.xml

User-agent: *
Allow: /

and upload it to your web root…

Error loading stylesheet: An unknown error has occurred

On some setups (usually using the WordPress MU Domain Mapping plugin) this error occurs. The problem is known, the cause is not… Until I find out why this is happening, please take comfort in knowing that this only affects reading the sitemap in normal browsers but will NOT affect any spidering/indexing on your site. The sitemap is still readable by all search engines!

XML declaration allowed only at the start of the document

This error occurs when blank lines or other output is generated before the start of the actual sitemap content. This can be caused by blank lines at the beginning of wp-config.php or your themes functions.php or by another plugin that generates output where it shouldn’t. You’ll need to test by disabling all other plugins, switching to the default theme and manually inspecting your wp-config.php file.

I see only a BLANK (white) page when opening the sitemap
There are several cases where this might happen.

Open your sitemap in a browser and look at the source code. This can usually be seen by hitting Ctrl+U or right-click then select ‘View source…’ Then scan the produced source (if any) for errors.

A. If you see strange output in the first few lines (head tags) of the source, then there is a conflict or bug occuring on your installation. Please go to the Support forum for help.

B. If the source is empty or incomplete then you’re probably experiencing an issue with your servers PHP memory limit. In those cases, you should see a messages like PHP Fatal error: Allowed memory size of xxxxxx bytes exhausted. in your server/account error log file.

This can happen on large sites. To avoid these issues, there is an option to split posts over different sitemaps on Settings > Reading. Try different settings, each time revisiting the main sitemap index file and open different sitemaps listed there to check.

Read more on Increasing memory allocated to PHP (try a value higher than 256M) or ask your hosting provider what you can do.

Can I run this on a WPMU / WP3+ Multi-Site setup?
Yes. In fact, it has been designed for it. Tested on WPMU 2.9.2 and WPMS 3+ both with normal activation and with Network Activate / Site Wide Activate.

Download

Latest version: Download XML Sitemap & Google News feeds 4.7.4 [zip]
Downloaded 766719 times.

Rated 4 out of 5 stars with a total of 31 votes on WordPress.org »

515 thoughts on “XML Sitemap & Google News feeds

  1. Blake

    So in Fetch as Google i added site map.xml

    The result was Completed.

    Do i need to hit the box that says submit to index?

    Reply
  2. Blake

    I clicked the link and this is what google sees


    Downloaded HTTP response:

    HTTP/1.1 200 OK
    Date: Thu, 25 Sep 2014 20:10:53 GMT
    Server: Apache
    X-Powered-By: PHP/5.3.28
    X-Pingback: http://www.hangardoors.aero/xmlrpc.php
    ETag: "57fb22d3a901c6f9c9a3add0e67c1282"
    Last-Modified: Sat, 20 Sep 2014 12:45:48 GMT
    Keep-Alive: timeout=2, max=100
    Connection: Keep-Alive

    Transfer-Encoding: chunked
    Content-Type: text/xml; charset=UTF-8

    < ?xml version="1.0" encoding="UTF-8"?>< ?xml-stylesheet type="text/xsl" href="http://www.hangardoors.aero/wp-content/plugins/xml-sitemap-feed/includes/xsl/sitemap-index.xsl.php?ver=4.3.2"?>






    http://www.hangardoors.aero/sitemap-home.xml
    2014-09-19T17:05:05+00:00


    http://www.hangardoors.aero/sitemap-posttype-post.xml
    2014-09-09T13:34:24+00:00


    http://www.hangardoors.aero/sitemap-posttype-page.xml
    2014-09-20T12:45:48+00:00


    http://www.hangardoors.aero/sitemap-posttype-portfolio.xml
    2014-09-17T20:19:11+00:00


    http://www.hangardoors.aero/sitemap-taxonomy-category.xml
    2014-09-09T13:34:24+00:00


    http://www.hangardoors.aero/sitemap-taxonomy-post_tag.xml
    2014-09-09T13:34:24+00:00


    Download Time: 0.568 seconds

    Reply
    1. RavanH

      Hi Blake, the comments are not really suited for pasting code (got chewed up) but it looks like your sitemap is OK. However, the response header “Last-Modified: Sat, 20 Sep 2014 12:45:48 GMT” looks like Google might be keeping an old sitemap instead of fetching the correct version. Do you have any new posts to publish? If not, could you modify (just open for editing and save again) a post or page? It should reset the last modified date. Then use the Test Sitemap in GWT to see if the error is solved…

      Reply
  3. Janine Grosenick

    Hey.

    I was really happy to have found your plugin, only great comments. I installed, went through the settings, saved, checked my sitemap. EMPTY! 🙁

    I couldn’t find a strange output in the first few lines as suggested nor the PHP Fatal error.

    I have never changed anything in the editor/css and my theme is compatible with your plugin.

    Please, do you have any ideas? Do you need more infos from me?

    Thanks a lot!

    Janine

    Reply
    1. RavanH Post author

      Hi Janine, can first go to Settings > Permalinks and resave the settings you have. Then check again. ALso try to see if the sitemap is available on the non-pretty URL yoursi.te/?feed=sitemap … let me know how that turns out 🙂

      Reply
  4. Tony

    Just curious if time zones matter in Google News sitemaps?
    I noticed the news sitemap uses GMT and wondered if specifying a time zone matters?
    2014-10-11T15:38:50+00:00
    or
    2014-10-11T08:38:50-07:00

    Reply
    1. RavanH

      Hi Tony, timestamps in the new sitemap could be in local time but Google should be able to convert the GMT time (as used now) to your local time without issues. In fact, I would not be surprised if Google News actually does the reverse first when you feed it local timestamps…

      Or are you experiencing problems? If so, please let me know!

      Reply
      1. Tony

        No problems, I was just curious if Google used timestamp in anyway for location or any other purpose. The way you have it is probably more appropriate.

        Reply
        1. RavanH

          Hmmm, no not that I’m aware of. Which timezone is used does not really matter (anymore) as long as it is clear to Google which one is used. I think I’ll make the plugin switch to local time in the next update because that is less confusing to site owners while Google will (should) not mind… Thanks for pointing this out 🙂

          Reply
  5. Pingback: How To Set Up A WordPress Blog in 9 Easy Steps

  6. Pingback: Robots.txt File, Sitemap.xml and the XML schema | Ninja Journal

    1. RavanH

      Hi NeedHelp, this plugin can only go as far as splitting by month. The maximum number of allowed URLs in a sitemap is 50k so that is not a problem but you’re probably running into a memory limit issue? Or maybe timeouts? Can you increase the max allowed PHP memory and timeout limit on your hosting platform? If not, you’ll probably need to start thinking about hosting that is more suitable for 10k posts per month… But even if you get it to work, maybe another sitemap solution is better for you because this one (it creates the sitemap as a feed on the fly) is probably too slow with such a huge number of posts.

      Reply
  7. Ali Chake

    First let me thank you for this great plugin,

    Your plugin is the only sitemap which works with WP Subdomains that turns categories into subdomains and my problem is that I have got a very active website and the split option which you implanted only splits sitemaps into years and months. Google webmaster tools says that two of my sitemaps can not be loaded… I checked it using safari and chrome and they did not work.

    they include more than 5K urls.

    Now would you please tell me how can I regenerate them or figure a way to solve this issue ?

    Thank you very much.

    Reply
    1. RavanH Post author

      Hi Ali, so you have set the Split by option to Month and you still have two months where the sitemap is not generated?

      This probably means the query is still just too big and the plugin runs into either the PHP memory limit or a timeout limit that is set on your server. You’ll have to check the error logs to find out more. You can then try ajusting the limit(s) in question to get the two remaining sitemaps live.

      But be aware that even if you get them live, the response will still be very slow and it just may be too slow for Google. Consider using Google Search Console (webmaster tools) to keep an eye on these big sitemaps and see how many of their URLs get indexed.

      Reply
      1. Ali Chake

        Thank you very much for the reply,

        Yeah I have set it to split the sitemaps monthly. So I am going to check the error logs.

        But I wonder if there is any way that you add an option to split the sitemap files into custom numbers like 2K for example or store the files locally to speed things up.

        Thank you again.

        Reply
        1. RavanH Post author

          Caching is planned for a future release. I’ll consider an alternative split method but I cannot promise anything because the current plugin structure is designed to use WordPress internal features (yearly and monthly archives is one of them) as much as possible. Splitting by day would be easy but this will very likely cause the sitemap index to get too big.

          Reply
          1. Ali Chake

            Thank you.

            Yeah you are right the daily option is not really logical.

            I am afraid that the caching option would not be helpful in my case either since my files are not being loaded in the first place.

            Anyways, I hope you come up with a solution for large websites like mine . This is the only plugin that I can use. Thank you again for your support.

    1. RavanH Post author

      Hi hbs, your /sitemap.xml is not from this plugin. You probably need to remove the static sitemap.xml file in your site root via FTP to get rid of it. Otherwise there is another sitemap plugin running.

      This plugin’s sitemap can be seen on /?feed=sitemap where you’ll notice the portfolio post type is included. After removing the static one, it should become accessible via /sitemap.xml too…

      Reply
          1. Hata

             Download of the sitemap or feed failed

            We encountered an issue when we tried to download this sitemap. Please check the sitemap for errors and resubmit the sitemap.

            I tried to resubmit but still failed

  8. Dave Robison

    Hi, I get a message that “no style is associated” with my sitemap and a basic tree view comes up under view…is this what I should see? When viewing the Google News section a “prettier” page is offered up.

    Reply
      1. Dave Robison

        Hey that was the issue, but I just uploaded your new update and can’t access my site, parsing error at ontheroadwithdave.com had to login under the wordpress.com site to contact you. Some kind of error with the upgrade
        Parse error: syntax error, unexpected ‘[‘ in D:\Hosting\2772443\html\wp-content\plugins\xml-sitemap-feed\includes\class-xmlsitemapfeed.php on line 703

        Reply
  9. Thomas Aggerholm

    Hi there, you got recommended by Irena Domingo (blog about sitemaps in multiple wp-languages).
    I’ve tried your plugin, but don’t seem to get past the “save settings” on configuration page. Get this error:

    Unhandled Exception

    Message:
    Only variables should be passed by reference

    Location:
    /home/forge/{clipped}/htdocs/content/plugins/xml-sitemap-feed/includes/admin.php on line 752

    Stack Trace:
    #0 /home/forge/{clipped}/htdocs/content/mu-plugins/themosis-framework/bootstrap/start.php(175): Themosis\Error\Error::native(2048, ‘Only variables …’, ‘/home/forge/sta…’, 752)
    #1 /home/forge/{clipped}/htdocs/content/plugins/xml-sitemap-feed/includes/admin.php(752): THFWK_Themosis->{closure}(2048, ‘Only variables …’, ‘/home/forge/sta…’, 752, Array)
    #2 [internal function]: XMLSF_Admin->sanitize_custom_sitemaps_settings(Array)
    #3 /home/forge/{clipped}/htdocs/cms/wp-includes/plugin.php(235): call_user_func_array(Array, Array)
    #4 /home/forge/{clipped}/htdocs/cms/wp-includes/formatting.php(3884): apply_filters(‘sanitize_option…’, Array, ‘xmlsf_custom_si…’, Array)
    #5 /home/forge/{clipped}/htdocs/cms/wp-includes/option.php(410): sanitize_option(‘xmlsf_custom_si…’, Array)
    #6 /home/forge/{clipped}/htdocs/cms/wp-includes/option.php(301): add_option(‘xmlsf_custom_si…’, Array, ”, ‘yes’)
    #7 /home/forge/{clipped}/htdocs/cms/wp-admin/options.php(215): update_option(‘xmlsf_custom_si…’, ”)
    #8 {main}

    Our site is hosted in forge, its a wordpress 4.2 installation based on themosis and polylang. We have installed “XML Sitemap & Google News feeds” version 4.6.3 – but get this error and are not able (most important actually) to get “one XML sitemap url per language” – we think we need to feed Google with one url per language.
    In polylang, we have chosen “The language is set from different domains” and entered 4 different domains (a Danish, Norwegian, Swedish, Finnish), but its only the Danish (main) that gets into the XML sitemap url.

    Hope you can shed some light on this, whether its our themosis-framework, polylang config or forge hosting, that could cause this?

    Reply
    1. RavanH

      Hi Thomas, are you still getting the error with the latest version? if so, could you please send the full error text via the contact form? About the more pressing matter: you have actually found the only feature that this plugin is not compatible with. Or at least not compatible ‘out of the box’ because you can get around it… On Settings > Reading, there is a field that allows you to set “additionally allowed domains”. By default, the plugin filters out all URLs that it finds that do not belong the the site’s domain, but in your case, it filters out the secondary language domaines because it is unaware of their validity. Adding them to that field, will let all language URLs pass and fill your main sitemap with all languages.

      The plugin was built to combine all languages instead of creating a sitemap per language. This should not be a problem for Google as long as you are the verified owner of all domains. You’ll need to get a Google Webmasters Tools account and add all domains there, passing validation, to make sure they will be accepted.

      Reply
  10. Pingback: XML Sitemap & Google News plugin now fully WPML compatible | Status 301 - Moved Permanently

  11. Molyeaja

    Thanks Previous and Greetings admin.
    I have a question: all my news articles in section / news, no blog posts. But news sitemap just sucks in the post kind of articles.
    An easy way to hack news sitemap plugin so that pipes in any news article?

    Reply
    1. RavanH

      Hi Molyeaja, there is the option “Include post types” in the Google News Sitemap section on your Settings > Reading admin page. Deselect “Posts” and select your “News” post type there.

      Reply
    1. RavanH Post author

      Hi Javier, yes that is indeed terrible. I’ve never seen that happen before. Have you got any paging/navigation plugins running? I notice you’r using WPML, is that configured correctly? Does the number if homepages correspond with configured (but deactivated) languages maybe? The sitemap-home.xml should be showing each language homepage (/de/ /es/ /ru/ etc…) but instead it is showing /1/ /2/ /3/ etc… Do those numbers correspond with the language ID’s maybe?

      Which WPML version (number) is installed on your site?

      Reply
    2. RavanH Post author

      I also notice there are only english posts and pages in the other sitemaps. Not good either… Looks definitely like a conflict/problem with WPML 🙁

      Reply

Leave a Reply