Generate sitemaps so your posts and pages can be found by search engines like Google or Bing.
Turn Sitemaps on
To enable Sitemaps, follow these steps:
- From your WP Admin, head to Jetpack → Settings.
- Head to the Traffic tab.
- Scroll down to the Sitemaps feature.
- Click the toggle switch next to Generate XML Sitemaps.
- Access your Jetpack Sitemap at
yourdomain/sitemap.xml
.
To help search engines find your website faster, we recommend submitting your sitemap (along with other information about your site) to the various webmaster tools programs that search engines offer, like Google Search Console and Bing Webmaster Tools. You’ll need to add and verify your site on both services before you’re able to submit the sitemap.
Types of sitemaps
Jetpack will generate four different sitemaps for you:
- A general sitemap for search engines, with your public posts and pages
- A news sitemap built specifically for Google News
- An image sitemap
- A video sitemap
Sitemap for search engines
The sitemap file generated by Jetpack is available to every search engine that supports the protocol, including Google, Yahoo!, Bing, Ask.com, and others. If you would like to learn more about the protocol, please visit sitemaps.org.
You can customize this filter to remove specific posts, pages, or URLs from your sitemap.
Jetpack automatically updates the sitemap file every 12 hours (or every time the content changes in the case of the News Sitemap). This happens on the server-side, not on Google. If you want to update the sitemap(s) directly in Google Search Console, please make sure that the sitemap’s XML file is first updated on the server.
News sitemap
News sitemaps are very similar to standard XML sitemaps for search engines, but they are specific to Google News. Publishers must be pre-approved for Google News before Google will index a news sitemap. News sitemaps include only posts published in the last 48 hours.
Once you activate the Sitemaps feature, you’ll be able to access your news sitemap at yourdomain/news-sitemap.xml
Approved publishers must log in to Google Search Console and add their news sitemap location as another sitemap.
Don’t forget to apply to get your posts listed in Google News.
Image and video sitemaps
The image and video sitemaps help search engines index media on your website so that it can be displayed in searches for that specific type of media, e.g., images or video files. The image and video sitemaps are generated by default. You can disable each respectively by adding the following code to your site. It is good practice to ensure that you have a recent backup of your site before modifying any code.
Disable image sitemap
add_filter( 'jetpack_sitemap_image_skip_post', '__return_true' );
Disable video sitemap
add_filter( 'jetpack_sitemap_video_skip_post', '__return_true' );
Excluding images and videos from their sitemaps
By default, all images and videos in your WordPress media library will be included in your image and video sitemaps.
However, you can use filters to exclude specific images and videos that:
- are not attached to any posts/pages or,
- are attached to posts/pages that are private or unpublished.
Excluding specific images from the image sitemap
It is good practice to ensure that you have a recent backup of your site before modifying any code. To exclude unattached images or images that are referenced by private or unpublished content, you can add the following code snippet:
add_filter( 'jetpack_sitemap_image_skip_post', 'jetpack_sitemap_image_skip', 10, 2 );
function jetpack_sitemap_image_skip( $skip, $post ) {
if ( 0 === $post->post_parent ) {
// Skip unattached images.
return true;
}
if ( 'publish' !== get_post_status( $post->post_parent ) ) {
// Skip images with an unpublished parent post
return true;
}
return $skip;
}
Excluding specific videos from the video sitemap
To exclude unattached videos or videos that are referenced by private or unpublished content, you can use the following code snippet:
add_filter( 'jetpack_sitemap_video_skip_post', 'jetpack_sitemap_video_skip', 10, 2 );
function jetpack_sitemap_video_skip( $skip, $post ) {
if ( 0 === $post->post_parent ) {
// Skip unattached videos.
return true;
}
if ( 'publish' !== get_post_status( $post->post_parent ) ) {
// Skip videos with an unpublished parent post
return true;
}
return $skip;
}
Please use our guide on how to add custom code to your site.
Sitemaps are automatically updated around every 12 hours by using WP-Cron. The effect of the filter will not take place until the next update.
If you are using Jetpack’s Site Accelerator (our CDN), the sitemap will list the original URLs even though the photos are served by the CDN.
Sitemap update frequency
- The News sitemap is generated when it’s requested. New posts are added to this sitemap right away.
- Other sitemaps including post, image, and video sitemaps are automatically updated around every 12 hours by using WP-Cron.
If you have noticed that your sitemaps are not updated after 12 hours, please contact us via our dedicated forum or via this contact form.
Add more post types to the sitemap
The default sitemap includes:
- Posts
- Pages
- Custom Post Types included in Jetpack: Portfolios, Testimonials, Simple Food Menus, and Comics
To add a new Custom Post Type to the default sitemap, use the jetpack_sitemap_post_types
filter to specify your own set of post types to include.
The News sitemap only lists posts by default. To add another post type to the News sitemap, use the jetpack_sitemap_news_sitemap_post_types
filter.
Choose which sitemap plugin to use
There are a number of plugins in the plugin repository that allow you to create sitemaps for your WordPress site. If you already use such a plugin, you can either remove that plugin and use Jetpack’s Sitemap feature instead, or leave Jetpack’s Sitemap disabled. We won’t activate our Sitemap feature if we detect you’re already using one of the more popular sitemap plugins on your site.
If you are using a different plugin for SEO-related stuff, stick with that. Alternatively, if you still want to use the Jetpack sitemap, please deactivate any other SEO or Sitemap plugins. Using multiple sitemap plugins can result in a “Sitemap cannot be read” error in Google Search Console, or other errors.
Increase the sitemap URL limits
Individual sitemaps have a limit of 1000 URLs to keep sitemaps within the 50MB size limit. If you need to increase that limit, you can add the following constants to your site’s wp-config.php file and edit the values as required:
define( 'JP_SITEMAP_MAX_ITEMS', 2000 );
define( 'JP_NEWS_SITEMAP_MAX_ITEMS', 1000 );
You will then need to deactivate and reactivate the Sitemaps module in Jetpack to trigger a new index. Keep in mind that generating sitemaps with thousands of URLs can take some time. It is good practice to ensure that you have a recent backup of your site before modifying any code.
Troubleshooting
General issues
Typical issues with sitemaps include:
- 404 error when loading the sitemap.
- Sitemaps are constantly being purged and moved to trash.
- Sitemap is blank, displays a white page, or shows a header with no URLs.
- Empty News sitemap.
- No XML-Tags or there are “Missing XML-Tag” errors.
The following troubleshooting steps should resolve these types of errors:
- Make sure you are using the most updated version of Jetpack.
- In WP Admin, go to Settings → Permalinks and click Save Changes.
- Check for conflicts: deactivate and reactivate your plugins one by one.
- Check for any security features you may have enabled, and try temporarily disabling them.
- Search for any firewall on your server-side that might be conflicting – your host should be able to help you.
- Toggle the Generate XML sitemaps feature off and on again under Jetpack → Settings → Traffic.
- If you use a caching plugin, make sure it is up to date and synced, or try disabling it.
- Check if you have any redirection plugins enabled. If you can’t find anything, ask your host to check for any rewrite rules that might interfere.
Blank or empty sitemaps
If your sitemap is blank, follow these additional troubleshooting steps:
Force a rebuild
If you have command-line access, run the following CLI command:
wp jetpack sitemap rebuild --monitor --purge
This clears out old sitemap data, generates and loads a new sitemap. It also logs errors it runs into to your site’s error log (for example, debug.log
).
If you don’t have command-line access, ask your host to run the command for you.
Check cron events with WP Crontrol
- Install the WP Crontrol plugin.
- Go to Tools → Cron Events.
- Look for
jp_sitemap_cron_hook
. If it is missing, the sitemap module cannot schedule the event to generate or update the sitemap. - If the
jp_sitemap_cron_hook
event is there, confirm the Next Run field is set in the future. If it is in the past, WP-Cron is not running properly on your server. Click Run now to manually trigger the event.
Confirm WP-Cron is running
Jetpack relies on WP-Cron to refresh your sitemap automatically when new content is published. If WP-Cron is disabled on your site or not functioning properly, your host should configure a real cron job that calls wp-cron.php
regularly.
Still need help?
Please contact support. We’re happy to advise.
Privacy Information
Sitemaps are deactivated by default. They can be activated any time by toggling the Generate XML sitemaps setting in the Sitemaps section from Jetpack → Settings → Traffic in your dashboard.
Data Used | |
---|---|
Site Owners / Users
The URL of the page/post, the title of the page/post, and the publication date of the page/post.Additionally, for activity tracking (detailed below): IP address, WordPress.com user ID, WordPress.com username, WordPress.com-connected site ID and URL, Jetpack version, user agent, visiting URL, referring URL, timestamp of event, browser language, country code. |
Site Visitors
None. |
Activity Tracked | |
Site Owners / Users
We track when, and by which user, the feature is activated and deactivated. |
Site Visitors
None. |
Data Synced (Read More) | |
Site Owners / Users
We sync options that identify whether or not the feature is activated and some additional information around sitemaps, including the state of the sitemap, the location of the sitemap, and which post types are included in the site map. |
Site Visitors
None. |