When WordPress version 5.5 was released earlier this year, it included support for basic sitemaps for the first time. This is a fantastic enhancement that improves the SEO of all sites which do not have an SEO plugin installed.
The release of Connections 10.0 extends the core WordPress sitemaps to include your directory Entries. While search web crawling bots can discover your directory Entries’ links, the sitemaps supplement this approach by providing the search bots a comprehensive list of all your directory Entry links.
Here are a few questions you might have and their answers.
Do I have to do anything to enable support for the sitemaps?
No, support is enabled automatically. But, there are conditions that must be met. They are as follows:
- The web host must support the native WordPress sitemap feature, which requires the SimpleXML PHP extension.
- The “Search engine visibility” option must be disabled on the WordPress Reading Settings admin page. This option is disabled by default.
- The Directory Homepage must be set on the Connections Settings admin page under the General tab. The
[connections render=false]
shortcode must exist on the chosen page. - The “Login Required” option must be disabled on the Connections Settings admin page under the General tab. This option is disabled by default.
- The “Name” permalink option must be enabled on the Connections Settings admin page under the Advanced tab. This option is enabled by default.
This may seem like a lot of requirements, but except for setting up the Directory Homepage, all the other requirements are default settings of WordPress and Connections.
Will private and unlisted Entries be in the sitemap?
No, only the Entries that are “Public” will be found in the sitemap.
Will Entries in the Moderation queue be in the sitemap?
No, the Entries must be approved in order for them to be listed in the sitemap.
I do not want the directory Entries to be in the sitemap, how can I disable this feature?
This functionality can be disabled with a filter.
add_filter( 'Connections_Directory/Sitemaps/Is_Enabled', '__return_false' );
The filter can be added to the theme’s functions.php
file or by using the Code Snippets plugin. The latter is the recommended method.
I’ve used the [connections render=false]
on pages other than the Directory Homepage, will those Entries exist in the sitemap?
No, by default only the Entries on Directory Homepage will be included in the sitemap. Additional pages can be registered with an action.
add_action( 'Connections_Directory/Sitemaps/Init', function() { // Change `1` (one) to the page ID of the page which should be added to the sitemap. // Change `name` to be a unique name. This must be characters a thru z only in all lowercase. // This is a requirement of the core WordPress sitemaps feature. cn_register_sitemap_provider( 1, 'name' ); } );
I do not use the core WordPress sitemaps feature. I use Yoast SEO or Rank Math; will Directory Entries show up in their sitemaps?
No, not at this time. Work is in progress on supporting these two SEO plugins.
Other changes in this update:
- TWEAK: Ensure the persistent log posts do not display in the WP sitemaps if the site is in debug mode.
- TWEAK: Use
rawurlencode()
when encoding the permalink for department, organization, district, county, locality, region, and country. - OTHER: Update readme.txt to make mention of the support of the native sitemaps support introduced in WordPress 5.5.