XML and Google News Sitemaps to feed the hungry spiders. Multisite, WP Super Cache, Polylang and WPML compatible.
This plugin dynamically creates dynamic feeds that comply with the XML Sitemap and the Google News Sitemap protocol. Multisite, Polylang and WPML compatible and there are no static files created.
There are options to control which sitemaps are enabled, which Post Types and archive pages (like taxonomy terms and author pages) are included, how Priority and Lastmod are calculated and a possibility to set additional robots.txt rules from within the WordPress admin.
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.
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, Yandex, Baidu, 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.
Please read the FAQ’s for info on how to get your articles listed on Google News.
Compatible with caching solutions like CloudFlare, WP Super Cache, W3 Total Cache and Quick Cache that cache feeds, allowing a faster serving to the impatient (when hungry) spider.
NOTES:
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.
On large sites, it is advised to use a good caching plugin like WP Super Cache, Quick Cache, W3 Total Cache or another to improve your site and sitemap performance.
XML Sitemap
Google News Sitemap
This plugin does not collect any user or visitor data nor set browser cookies. Using this plugin should not impact your site privacy policy in any way.
Data that is published
An XML Sitemap index, referencing other sitemaps containing your web site’s public post URLs of selected post types that are already public, along with their last modification date and associated image URLs, and any selected public archive URLs.
A Google News Sitemap containing your web site’s public and recent (last 48 hours) URLs of selected news post type, along with their publication time stamp and associated image URL.
An author sitemap can be included, which will contain links to author archive pages. These urls contain author/user slugs, and the author archives can contain author bio information. If you wish to keep this out of public domain, then deactivate the author sitemap and use an SEO plugin to add noindex headers.
Data that is transmitted
Data actively transmitted to search engines is your sitemap location and time of publication. This happens upon each post publication when at least one of the Ping options on Settings > Writing is enabled. In this case, the selected search engines are alerted of the location and updated state of your sitemap.
If you’re happy with this plugin as it is, please consider writing a quick rating or helping other users out on the support forum.
If you wish to help build this plugin, you’re very welcome to translate it into your language or contribute code on Github.
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.
I. If you have been using another XML Sitemap plugin before, check your site root and remove any created sitemap.xml, sitemap-news.xml and (if you’re not managing this one manually) robots.txt files that remained there.
II. Install plugin by:
Quick installation via Covered Web Services !
… OR …
Search for “xml sitemap feed” and install with that slick Plugins > Add New admin page.
… OR …
Follow these steps:
Download archive.
Upload the zip file via the Plugins > Add New > Upload page … OR … unpack and upload with your favourite FTP client to the /plugins/ folder.
III. Activate the plugin on the Plugins page.
Done! Check your sparkling new XML Sitemap by visiting yourblogurl.tld/sitemap.xml (adapted to your domain name of course) with a browser or any online XML Sitemap validator. You might also want to check if the sitemap is listed in your yourblogurl.tld/robots.txt file.
Same as above but do a Network Activate to make a XML sitemap available for each site on your network.
Installed alongside WordPress MU Sitewide Tags Pages, XML Sitemap Feed will not create a sitemap.xml nor change robots.txt for any tag blogs. This is done deliberately because they would be full of links outside the tags blogs own domain and subsequently ignored (or worse: penalised) by Google.
Upon uninstalling the plugin from the Admin > Plugins page, plugin options and meta data will be cleared from the database. See notes in the uninstall.php file.
On multisite, the uninstall.php can loop through all sites in the network to perform the uninstalltion process for each site. However, this does not scale for large networks so it only does a per-site uninstallation when define('XMLSF_MULTISITE_UNINSTALL', true);
is explicitly set in wp-config.php.
On Settings > Reading you can enable the XML Sitemap Index and (if needed) the Google News Sitemap. There is also an Additional robots.txt rules field.
Once a sitemap is enabled, its options can be found on Settings > XML Sitemap or on Settings > Google News.
Ping settings can be found on Settings > Writing.
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 Search Console account to check its validity and performance. Create an account if you don’t have one yet.
You can find default settings for Priority on Settings > XML Sitemap. A fixed priority can be set on a post by post basis too.
Changefreq has been dropped since version 4.9 because it is no longer taken into account by Google.
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.
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.
Google & Bing are no longer accepting sitemap pings.
In normal circumstances, if you have no static 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.
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.
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.
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 Search Console 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.
No. If you have fancy URL’s turned ON in WordPress (Permalinks), the sitemap url is yourblogurl.tld/sitemap.xml
but if you have the Permalink Default option set the feed is only available via yourblog.url/?feed=sitemap
.
There is no actual file created. The sitemap is dynamically generated just like a feed.
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.
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.
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 Search Console 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 known 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.
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 > XML Sitemap. 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.
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.
20240506
* FIX: Unauthenticated file inclusion – CVE-2024-4441 reported by Foxyyy
20240329
* FIX: blog_public can be integer when object cache is used
* FIX: compatibility date redirect warning when using core server
* FIX: rewrite rules conflict with Polylang
* FIX: call to undefined function with Nginx Helper
20240221
* FIX: wp-cli disable plugin incompatibility
* FIX: trailing slash
* FIX: split by month
* FIX: disabled post types in index
* ClassicPress and WP pre-5.5 compatibility
* FIX: Undefined contact on uninstall
* FIX: admin compatibility message
20240219
* NEW: Switch between Plugin or WP core sitemap server for sitemap generation
* NEW: xmlsf_generator action hook
* NEW: xmlsf_sitemap_index_pre and xmlsf_sitemap_index_post action hooks
* NEW: xmlsf_author_has_published_posts filter
* Dropping all Ping Services (no longer supported)
* Dropping allowed domains filtering
* Exclude spammed or deleted authors on multisite
* Updated help links
* Update coding standards
* FIX: Don’t use transients if not strictly needed
* FIX: “Failed opening required” when no template
* FIX: Conversion of false to array deprecated warning
20230810
* FIX: Work around get_users() fatal error in WP 6.3
* FIX: Wrong Nginx helper purge urls (backport from 5.4-beta)
20230629
* FIX: Forced Status 200 response conflict with Etag/If-None-Match headers, thanks @revolutionnaire
20230530
* FIX: File not found error on invalid sitemap requests
* FIX: Lastmod date older than post date on scheduled posts
20230528
* FIX: Undefined variable + Invalid argument supplied for foreach(), thanks @yankyaw09
xmlsf_request
and xmlsf_news_request
xmlsf_news_publication_name
and xmlsf_news_title
xmlsf_url
xmlsf_news_url
and xmlsf_news_tags_inner
xmlsf_index_url_args
filterxmlsf_news_tags_after
to after closing tag20191111
* NEW: Ad Inserter compatibility check
* NEW: xmlsf_urlset and xmlsf_news_urlset action hooks, thanks to Stanislav Khromov (@khromov)
* Exclude hierarchical post types from news sitemap
20191009
* NEW: xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks
* Make stylesheet paths relative to prevent exclusion when using different language domains
* FIX: Taxonomy selection not available to new installs
20190917
* NEW Rank Math incompatibility admin warnings
* FIX undefined index
* FIX invalid form control
20190429
* Image query optimization and meta caching
* Last comment date meta caching
* Lastmod and publication dates in local time
* Removed ignored image tag from news sitemap
* Max memory limit for post type and taxonomy term sitemaps
* Prevent CDN file urls
* Zlib before GZhandler on .gz request
* FIX: don’t ping for excluded posts
* FIX: traditional and simplified Chinese with WPML
* FIX: redundant front page url
* FIX: array_filter() expects parameter 1 to be array
* FIX: possible division by zero
* FIX: update_term_modified_meta
* FIX: rewrite rules on deactivate/uninstall
20190313
* SEOPress and Catch Box incompatibility admin messages
* FIX bbPress incompatibility
* FIX failing last modified date for taxonomy sitemaps
* FIX sitemap showing when only private posts
* FIX possible sitemaps for no longer existing post types in index
* Admin interface improvements: highlighting and scroll
* Upgrade routines in own class only to be included when needed
* Moved metabox methods to dedicated classes
* NEW Respond to .gz requests (with ob_gzhandler output buffering if needed)
* NEW filters xmlsf_disabled_taxonomies, xmlsf_news_keywords, xmlsf_news_stock_tickers
* NEW action xmlsf_ping
* NEW Tools: Ping search engines and Flush rewrite rules
20181025
* Allowed domains back to Settings > Reading
* FIX static files check on activation
* NEW Admin warning on conflicting plugin settings
* FIX Empty post priority saved as 0.0
* FIX Call to undefined function xmlsf_get_archives()
* FIX force LC_NUMERIC locale to C
* FIX Call to private method
* FIX Custom post types with a hyphen not showing
* FIX Admin static files message fatal error, thanks @kitchin
* FIX Improper if statement in upgrade routine, thanks @kitchin
* FIX PHP 5.4 compatibility issues
20180908
* Complete code restructure and cleanup: MVC and JIT inclusion
* Fewer DB queries, much smaller memory footprint on normal queries
* NEW Admin interface with dedicated options pages and help tabs
* NEW Taxonomy term options: priority and automatic calculation
* NEW Admin warning on conflicting static files
* NEW Option to delete conflicting static files
* NEW Filters for post types: xmlsf_post_types and xmlsf_news_post_types
* NEW Filters for priority values: xmlsf_post_priority and xmlsf_term_priority
* Removal of Genre, Keywords and Access tags as Google dropped support
* Taxonomy term sitemaps speed improvement: get lastmod date from database
* Exclude Woocommerce product_shipping_class taxonomy
* PHP 7.2+ compat: create_function deprecated
* No more domain filtering for custom URLs and external sitemaps
* FIX Gutenberg editor GN genre taxonomy not showing
* FIX Plain and /index.php/ permalink structure
* FIX Clear all options on uninstall
* FIX Pings
20180507
* Code cleanup
* NEW: FactCheck genre
* Changefreq tag dropped
* NEW: translation strings for genres
* FIX: zlib.output_compression compatibility, thanks @alicewondermiscreations
* FIX: permalink issue with Woocommerce account page endpoints
* FIX: undefined index in news post types
20180316
* NEW: Conditional functions is_sitemap() and is_news()
* code cleanup and annotation
* new google ping URL
* revisit get first/last date/modified functions and cache key set/delete
* FIX: cache key missing timezone
* FIX: wp_rewrite init before flush_rules
20161207
* FIX: On cache_flush purge also the respective time_key cache entry,
props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-in-outdated-last-modified-values-on-index-sitemap/
* FIX: Variable variable php 7 compat
* Detect if headers are already sent and print warning in source
20160506
* WPML compatibility
* FIX: News Sitemap chinese language tag
* FIX: flush rules on plugin re-activation
20160407
* Code cleanup
* POT file update
* Dutch translation update
robotstxt_sitemap_url
for any translate and url changing plugins.add_feed
(on init) to the do_feed_$feed
hookis_404()
condition TRUE and Response Header 404 on sites without postsis_feed()
condition FALSE after custom query_postsget_post_modified_time
instead of get_post_time