Simplifying the life of developers and, at the same time, search engines, creating a standard for the sending of sitemaps through a function integrated into the core of the CMS. This was the spirit with which last year was announced the intention of the WordPress core development team to work on a feature that would allow by default the creation of sitemaps in WordPress, completed in recent days with the launch of Core Sitemaps.
WordPress XML sitemap, here comes an official plugin
As already explained at the launch of the proposal this past year, the WordPress team meant on integrating the basic and extensible functionality of XML sitemaps within the WordPress Core: in these twelve months the work continued on GitHub and with weekly meetings in the #core-sitemaps channel, leading to the release of several versions of the plug-in on the repository in WordPress.org before the final one, which is considered ready to “join the core”.
At the moment, the plugin does not allow you to intervene on sitemaps image/video/news, a choice wanted to first focus on this other – and large – area of interest, but are not excluded next extensive updates.
What is WordPress Core Sitemaps
A company blog post describes in detail the purpose and objectives of this feature, which provides the basic functionality required for the Sitemaps protocol for core WordPress objects, allowing developers to extend this functionality with a robust and consistent set of filters.
For instance, you can check which types of objects include (posts, taxonomies, authors) or sub-types of objects (post types, taxonomies), and then again exclude specific entries or extend sitemaps to add optional fields.
WordPress XML Sitemaps, an easier scan for crawlers
This plugin promises to improve the lives of developers and search engines, as we said in the opening: as we know, in fact, Sitemaps help sites to become more detectable as they offer search engines a map of contents that should be indexed.
Web crawlers are able to discover pages from links within the site and from other sites, but sitemaps facilitate this approach by allowing them to quickly and comprehensively identify all the URLs included in the map and learn other signals about those URLs by using the associated metadata.
In summary, the article reminds us, Sitemaps is a URL inclusion protocol and integrates robots.txt, a URL exclusion protocol; an XML Sitemap lists the URLs of a site and may optionally include information about each of it, like when it was last updated, how often it changes and how important it is compared to other site URLs. This information allows search engines to scan the site more effectively and so to find out every public URL made available.
How to generate a sitemap with WordPress
Thanks to the new WordPress Core Sitemaps plugin you can then generate XML Sitemaps automatically for each site hosted on the CMS. As Pascal Birchler explains, maps are enabled by default to make a number of object types indexable:
- Homepage
- Posts page
- Main post types (i.e. pages and posts)
- Types of custom posts
- Main taxonomies (i.e. tags and categories)
- Custom taxonomies
- Author’s Archives
Moreover, the robots.txt file displayed by WordPress will refer to the Sitemap index.
How Core Sitemaps works
A crucial feature of the Sitemap plugin is the Sitemap index, the main XML file that contains the list of all Sitemap pages displayed by a WordPress site. By default, the plug-in creates a Sitemap index in /wp-sitemap.xml where it includes maps for all supported content, divided into groups by type. Each Sitemap file contains up to 2,000 URLs and when this threshold is reached it creates a new Sitemap file.
As said, by default WordPress sitemaps are created for all types of public posts and taxonomies, as well as for authors’ archives. There are several filters to change this behavior and, for instance, to include or exclude certain items; furthermore, there are many links available for plug-ins to be integrated with this feature, if the developers so wish, or to disable it completely if they prefer to roll-up their own version.
What to do with the other WordPress sitemap plugins
It is the same Birchler to explain what happens now to the many sites that already have an active third-party plug-in that implements sitemap: “for most of them, this will no longer be necessary, as the core functionality of WordPress is enough“, he writes. However, there is no problem in keeping them active because the Sitemaps Core functionality “was created in a robust and easily extendable way“, and if for some reason “two sitemaps are displayed on a website (one per core, one per plug-in), this does not lead to negative consequences for the detectability of the site”.