FB pixel

How to Create an XML Sitemap on WordPress

16 19.08.2025

A sitemap (WordPress Sitemap) is an important tool for SEO and website indexing, although it is not a direct ranking factor. Its key function is to make it easier for search engines to crawl and index content by helping them efficiently discover new pages and promptly respond to site updates.

The main value of a sitemap for SEO lies in improving indexing. It provides search engine bots with a complete and up-to-date list of all pages, including text pages, images, videos and news. This is particularly important for large and complex sites where bots find it difficult to cover all content through normal crawling. A sitemap is also extremely useful for new projects that lack external links for natural discovery of all pages, as well as for sites with deep hierarchy and isolated pages that have no internal links pointing to them.

In addition, a sitemap for WordPress significantly speeds up the indexing process. For news resources, blogs and other websites with frequently updated content, an XML sitemap allows search engines to learn about new publications quickly and include them in their index faster. For multilingual sites, having a sitemap with properly configured hreflang attributes ensures correct indexing and display of pages in different languages in the corresponding regional search results. The sitemap.xml file helps search engines better index multimedia content, such as images and videos, increasing the likelihood of them appearing in specialized search results.

It is important to remember that the presence of an XML sitemap alone does not guarantee high rankings or mandatory indexing of every page. Search engines consider many factors, including the quality and uniqueness of the content. A website sitemap is merely an auxiliary tool that facilitates the work of search bots and indirectly influences SEO. It should not be seen as a replacement for proper internal linking and quality content.

In addition to standard sitemap.xml files intended for bots, there are also HTML sitemaps created specifically for users to help them navigate and find the necessary content on the site.

How to Create a Sitemap on WordPress

You can create a WordPress sitemap in several ways, the simplest of which is using the platform's built-in feature. Starting from version 5.5, WordPress automatically generates a basic XML sitemap available at /wp-sitemap.xml or /sitemap.xml. This sitemap is automatically updated when content is added or edited, making it suitable for most new projects or small websites. However, the built-in tool has limited capabilities: for example, it does not allow flexible exclusion or customization of individual content types.

If you need advanced features and control over sitemap generation, it is recommended to use specialized plugins such as Yoast SEO, Rank Math, Google XML Sitemaps or All in One SEO Pack. These solutions allow you to configure update frequency, page priority, exclude certain sections and content. There is also an option to manually create and upload an XML sitemap file to the server without using plugins.

Creating a Sitemap Using WordPress Plugins

Creating a sitemap using WordPress plugins significantly expands sitemap management capabilities. Let’s look at the most popular solutions.

Yoast SEO

This is one of the most popular and comprehensive SEO plugins, offering a wide range of features for content optimization and technical SEO, including XML sitemap generation.

  1. Install and activate the Yoast SEO plugin.
  2. In the admin panel, go to SEO → General → Features.
  3. Find the XML Sitemaps option and make sure the switch is turned on (it should show status On). If the feature is disabled, enable it.
  4. Save the changes. The plugin will automatically generate/update the sitemap when this feature is enabled.
  5. View the sitemap. Next to the XML Sitemaps option, click the question mark icon and click the link See the XML sitemap. This will open your sitemap in a new window.

Google XML Sitemaps

This is a specialized and very simple plugin that focuses exclusively on creating XML sitemaps.

  1. Install and activate the Google XML Sitemaps plugin (XML Sitemap Generator for Google).
  2. After activation, the plugin will automatically generate the default sitemap.
  3. To configure the sitemap settings, go to Settings → XML-Sitemap in the WordPress admin panel. On the settings page, you will see information about the location of your sitemap and the status of search engine notifications.
  4. Select content types to include or exclude. The settings page provides options to mark which posts, pages, categories, tags, etc. should be included in the sitemap. Additional settings are also available (e.g. whether to notify Google and Bing about updates, whether to add the sitemap link to robots.txt, etc.) – configure them if necessary.
  5. Save the changes by clicking the Update Options button. This action will save the selected settings and (on the first save) create/update the XML sitemap. Do not forget to save, otherwise the changes will not take effect.
  6. Check the sitemap. After saving the settings, make sure the sitemap is available. If successfully created, there will be an XML file containing links to all the sections selected in the settings.

All in One SEO Pack

Like Yoast SEO, this is a full-featured SEO plugin that provides extensive website optimization capabilities, including sitemap generation, meta tag management, Schema Markup integration and more.

  1. Install and activate the All in One SEO Pack plugin. Upon first launch, the plugin may open a setup wizard – make sure that the Sitemap feature is enabled in the wizard (it is active by default in the typical configuration).
  2. In the admin panel, go to All in One SEO → Sitemaps. The General Sitemap screen with basic sitemap settings will open. Here you should see the Enable Sitemap switch – make sure it is on (if it was off, activate it).
  3. Configure the sitemap content. Scroll down the settings page. In the Sitemap Settings section, make sure that the main content types such as Posts and Pages are included in the sitemap (they should be checked). AIOSEO allows you to include or exclude various post types and taxonomies from the sitemap. For example, if you do not want to include tag archives or post formats, they can be disabled.
  4. Save the changes. Scroll to the bottom of the page and click Save Changes.

Rank Math SEO

A relatively new but rapidly growing SEO plugin that positions itself as a more powerful and multifunctional alternative to Yoast SEO.

  1. Install and activate the Rank Math SEO plugin. During the first launch, complete the initial setup (Setup Wizard). At one of the steps, make sure the Sitemap module is enabled. Usually, the wizard suggests activating the main modules right away. If you skipped this step, don't worry – the module can be enabled later in the Rank Math settings.
  2. In the admin panel, go to Rank Math → Sitemap Settings. This will open the XML sitemap configuration page. Make sure the sitemap functionality is indeed active (the presence of this page means the Sitemap module is working). If the sitemap is disabled for some reason, go to Rank Math → Dashboard and manually enable the Sitemap module.
  3. Configure which content types will be included in the sitemap. In Rank Math, sitemap settings are divided into tabs for different types of content: General, Posts, Pages, Categories, Tags.
  4. Save changes on each tab if you made any edits. The Rank Math sitemap is created dynamically and automatically updates when new content is added or settings are changed.

After configuring the plugin, the XML sitemap is usually available in the root domain at an address like: https://example.com/sitemap\_index.xml (where example.com is your actual domain).

To check if the plugin is correctly configured, simply enter this URL in the browser's address bar. Note that different plugins may use different names and structures for the sitemap. For example, the Yoast SEO and Rank Math SEO plugins create a file named sitemap_index.xml, while Google XML Sitemaps and All in One SEO Pack more often use the name sitemap.xml.

Manual Sitemap Creation

If the sitemap is created manually, it is important to remember that you will need to manually or automatically update this file every time you make changes to your site (add or delete pages).

  1. Open any text editor and create a new file named sitemap.xml.
  2. Insert the following code into the file:
    		
          
          
          
          Page URL
          
          
          
        
  3. For each page of your website that you want to include in the sitemap, add the following markup between the tags:
    		
              
              
              Page URL
              
              
          
        
  4. Save the sitemap.xml file and upload it to the root directory of your site.

Conclusion

An XML sitemap is an important tool for improving the indexing and SEO optimization of your website. Be sure to add it to Google Search Console. To do this, go to the Sitemaps section, paste the URL of your sitemap and submit it for verification. This will ensure the timely discovery and indexing of new or updated pages of your website in Google's search results.

Learn more about how to purchase a domain, hosting, VPS, or dedicated server.

FAQ

How can the presence of an XML Sitemap file affect the indexing speed of your website's new pages by search engines?

The presence of an XML Sitemap file helps search engines find and index new pages on your website more quickly because it provides a structured list of all available pages. This speeds up the discovery of content and its inclusion in search results.

What is the main advantage of using plugins to create an XML Sitemap compared to the built-in WordPress function?

Plugins for creating XML Sitemaps, such as Yoast SEO or Rank Math, offer significantly more settings and control over the sitemap content than the built-in WordPress feature. They allow you to exclude certain content types, set priorities and update frequencies, and automatically notify search engines about changes.

What key settings should be checked when using the Yoast SEO plugin to generate and manage a sitemap?

When using Yoast SEO, make sure the XML sitemap feature is enabled and check the «Post Types» and «Archives» sections in the sitemap settings. Here you can choose which content types (posts, pages, categories, tags) should be included or excluded from your sitemap.

Are there situations when manually creating a sitemap may be preferable to using plugins in WordPress?

Manually creating a sitemap may be preferable for very small websites with simple static content that rarely changes.

What are the alternative ways to inform search engines about the location of the XML Sitemap file besides direct submission through Google Search Console?

Besides Google Search Console, you can specify the location of the XML Sitemap file by adding the line Sitemap: https://example.com/sitemap.xml at the end of your website’s robots.txt file.