It is an important question because the sitemap provides information about files on your website. This data helps search engines to crawl your page correctly. You may watch a video by Daniel Waisberg to learn more about sitemaps and understand whether you need one or not.
If your website doesn’t have a sitemap yet, you can create one following these instructions.
While updating certain pages of your website, you want to be careful to avoid losing high rankings and indexation. One of the difficulties someone can face is determining whether to update the sitemap immediately after setting the 301 redirect. And here is a spoiler: to avoid misleading search engines, your sitemap has to remain “clean,” that is, without 301 “dirt.”
What Does “301 Included in Sitemap” Mean?
Unlike the temporary 302 redirects, 301 indicates that the requested page has been moved to a new address permanently. The message about a 301 error appears when the server considers the requested address to be invalid and wants to redirect a user to a new URL. The webserver fails to redirect from an old page to a new one when there is an issue with a redirection request. It is a common problem that occurs after updating a website.
What Triggers This Issue?
It happens when URL addresses on your sitemap return an HTTP “Redirect” status (3XX). Therefore a “301 Moved Permanently” error message can be triggered by the following reasons:
- The destination URL is not linked properly, or URLs are broken.
- The website or the page is new.
- There are some problems with custom code.
- The URL of an old webpage has been updated, and the link now redirects to another page.
- Search crawlers were confused because the sitemap contains the old and the updated addresses of the same page.
How to Check the Issue
To determine if a 301 error is included in your XML sitemap, you can use one of the free third-party tools — redirect-checker, httpstatus, and others. Another way is to download your sitemap and use a filter to find out if any lines contain a 301 status code. You can also check it manually by yourself: go to the URL bar of your website and find https://, delete “s,” and click on “Enter” once there is only http:// left in the beginning. If the website redirects to https://, then there are no issues with this particular page.
Checking 3xx redirect in sitemap is important but not enough to rank good enough!
Check not only the issue but make a full audit to find out and fix your technical SEO.
Why Is This Important?
It is important to not underestimate the necessity of keeping your sitemap “clean,” meaning that it has to contain only updated links (200 status URLs). The Search Advocate at Google, John Mueller, suggested in this Tweet to list all the URLs that have to be indexed. Search engines use the sitemap to choose a canonical URL for a page. It might get confusing if the URL in the sitemap redirects to another one.
Ignoring the 3xx error can lead to various issues — from a decline in organic traffic to indexation problems. By fixing the issue, you will also avoid 404 errors in the future.
How to Fix the Issue
Here is a good piece of advice: to ensure that nothing will get lost, make a complete backup of the website database before taking any actions. After that, you can get rid of the 301 error by using one of the following methods.
1. Clean the Sitemap
To remove the “3xx redirect in sitemap” error, one needs to replace all redirecting URLs with the destination ones. If these links are already on your sitemap, then the task is even easier: you should simply delete the wrong URLs. One of the ways to do that is to download a list of all URLs, find any 301 status codes, and replace them with updated ones.
2. Review the Configuration Files for the Webserver
If you’re using Apache, you need to:
- Find a .htaccess file inside your directory. This file will help you determine the whereabouts of any redirections.
- You should open the .htaccess file in a text editor and find the lines with RewriteXXX directives — RewriteCond or RewriteRule. Check both of them for any redirect instructions to invalid URLs.
- If there are any wrong redirects, you should remove them and check if that helped solve the issue on the website.
If you’re using nginx, you’ll need to find a configuration file called nginx.conf. The following steps are similar: you should open it in a text editor, but in this case, the directives you need will be named Return or Rewrite.