How to Optimize Your XML Sitemap for Maximum SEO

Photo of author
Written By tsboi team

The Best Url Shortener, QR Codes, Bio-Profile Link & File Sharing Platform.

When optimizing your website for SEO, one of your goals is to provide Google with the right signals so that it can better index your website. An optimized XML sitemap is one of those signals that can lead to faster indexing and higher rankings.

What is an XML Sitemap and why do you need one?

In simple terms, an XML sitemap is a file that lists all the important pages on your website that search engine crawlers need to know about.

Even if you don’t have a sitemap, they can still index your website, but having a sitemap makes their job easier and also gives you the opportunity to let them know about the pages and parts of your website that they may not easily discover. .

There are different types of sitemaps, you can submit a sitemap for your posts, images and videos.

When is a sitemap really important?

  • For websites with many pages, a sitemap helps search engines discover new or updated pages.
  • For websites that do not use good internal linking practices, A sitemap is a great way to give crawlers information about the pages on your website.
  • For new websites that don’t have many inbound links, a sitemap will serve as a discovery tool.

How to create an XML sitemap?

There are many ways to create a xml sitemap. Many platforms have this functionality built in, but even if they don’t, it’s easy to create one and reap the benefits.

To check if your website has a sitemap, you can open a new browser window and navigate to

SEO training

You need to understand that a sitemap is not a static file, but should update automatically when a new page is added to your website or when changes are made to existing pages.

For this reason, you should look for automated ways to create a sitemap.

For non-WordPress websites, the best way to create a sitemap is to search Google for plugins or software that are integrated into your platform and can generate sitemaps according to Google’s guidelines.

For WordPress websites, there are many plugins to help you. Below I will show you step by step instructions on how to create and optimize your XML sitemap using Yoast SEO.

Watch the video tutorial to learn how to create an XML sitemap, what to include in your sitemap for maximum SEO, and how to submit your sitemap to Google.

What to include in your XML sitemap for maximum SEO?

Before getting into the implementation details, it’s important to understand what you should include in your XML sitemap for maximum SEO.

By default, plugins will include all your website pages, posts, tags, files, media, etc., but this is not what we want for SEO purposes.

The most important sitemap optimization guidelines are:

Include on your sitemap the pages (and that includes posts too), which are important to your website. These are the pages that have high-quality content and are most likely to bring organic traffic to your website.

Exclude Pages that have duplicate content. For WordPress websites, good candidates are archive pages, tag pages, and author pages.

Exclude pages with ‘thin content‘. When it comes to optimizing a website for search engines, you don’t want to submit pages that are of low quality to their indexes. It’s not a numbers game, which means it’s not about how many pages you have in the index, but how many “good” pages are in the index.

A good way to separate your ‘good pages’ from the ones you don’t want to include in your sitemap is to ‘do not index’ the pages or add them to a category and exclude the particular category (and pages) from the sitemap file. .

Organize your sitemap into sub-sitemaps. This has the added benefits of making sitemaps smaller and faster to process.

Send a separate sitemap for your videos (if applicable).

Add your sitemap in robots.txt. I have explained before how Position your robots.txt file and on top of that, you can also add your sitemap location to help search engines find your sitemap file more easily.

Include only the URLs that Google can access. If you have pages that are blocked by bots or behind a password-protected area, don’t include those pages in the sitemap.

Make sure your XML sitemap includes the ‘last modified time’ field, a value that provides information to Google about when a page was last modified. This is useful in cases where you want Google to re-index some pages on your website.

last modification time in sitemapsLast Modified Time in Sitemaps

Creating an XML Sitemap with the Yoast SEO Plugin

One of the nice features of Yoast SEO is the functionality of the sitemap.

If you have the plugin installed and activated, the first thing you need to do is ‘Enable XML Sitemap functionality’ by going to Yoast SEO -> GENERAL -> FEATURES -> XML SITEMAPS.

XML Sitemap with Yoast SEOEnable XML sitemap functionality in Yoast SEO

The next step is to configure what to include in your XML sitemap.


Search Appearance SettingsSearch Appearance Settings

For each of the content types, you need to decide if this is something you want to include in your sitemap.

If you set “Show posts in search results?” to YES, then the particular content type will be included in your sitemap, if you choose NO it will not be included.

In most situations, you only need to include your posts, pages, and products (for eCommerce websites) and exclude everything else.

Next, you need to select TAXONOMIES and do the same. In other words, you have to select which taxonomies you want to include in your sitemap or not.

In a normal scenario, you should only include your posts and product categories and exclude anything else like post tags or pages that don’t have unique content of their own.

Taxonomies in XML SitemapTaxonomies in XML Sitemap

The next and final step is to go to FILES and disable Files by author and date.

Files in XML sitemapFiles in XML sitemap

Where is my XML sitemap?

To view your sitemap, click VIEW XML SITEMAP under GENERAL / FEATURES (first screenshot above), or open a new browser window and go to

XML Sitemap ExampleXML Sitemap Example

As you can see in the screenshot above, the plugin created a sitemap by content type.

If you click on any of the links, you’ll also see that it contains information for images, so you don’t need to create a separate sitemap to submit your images to Google.

How to submit your XML sitemap to Google?

There are two ways to Submit your sitemap to Google.

The first way is to add it to robots.txt and the second way is to submit your sitemap in Google Search Console.

For best results, you can use both methods.

Add your sitemap in robots.txt

Edit your robots.txt file as explained hereand add a line at the end to include your sitemap as shown below.

Sitemap in Robots.txtSitemap in Robots.txt

If you don’t know what robots.txt is and what it does, read this helpful guide: How to use robots.txt

To submit your XML sitemap in Google Search Console:

Login in Google search console


Type the file name of your sitemap (ie sitemap_index.xml) and click the SEND button.

Submit sitemap to Google Search ConsoleSubmit sitemap to Google Search Console

Once you do this, you will see that the sitemap is Pending. Check back in a few days to see how many pages were submitted on your sitemap and how many pages are actually indexed.

You can see all the details in the COVERAGE report (under Index).

Note: It’s normal for Google not to index all of your pages, especially if you’ve added unimportant pages to your sitemap.

When do you need to submit an RSS feed to Google?

In addition to submitting an XML sitemap, there are cases where you can submit an RSS feed to Google.

When you have a large website with many pages that change frequently (for example, a news website), you can use a RSS Feed to inform Google of new additions to the website.

Your RSS feed will be smaller and will only include your new pages (so it will render faster), while your sitemap will include ALL your pages.


Having a valid XML sitemap that search engines can read is important for SEO.

Anything you can do to make their job easier and any way you can use to give them more information about the structure and content of your website will improve your website’s presence in their index.

Creating an XML sitemap is easy as there are many plugins that automate the process for you.

In addition to having a sitemap, if your website has a lot of content (pages, posts, etc.) and if you have new additions on a daily basis, you can also submit your RSS feed to Google (the same way you do with a sitemap). and thus speed up the indexing of your new content.

Rate this post

Leave a Comment