There are times when you might want to manually or automatically add specific pages or URLs to the sitemap.xml
file of your WordPress site. The Rank Math SEO plugin is one of the powerful tools that provides you with the means to easily include your custom URLs in the sitemap.xml
file. In this tutorial, we will guide you on how to perform this task using Rank Math SEO.
First, you need to ensure that you have the Rank Math SEO plugin installed and activated on your WordPress site. This plugin gives you the ability to better manage your site’s search engine optimization and offers various tools for improving your SEO. After installation, visit the WordPress dashboard and enter the Rank Math SEO settings.
One of the key features of this plugin is the ability to add custom URLs to the sitemap.xml
file. To do this, navigate to Sitemap Settings in the Rank Math settings. Here, you can configure the sitemap file settings.
Now, to add custom URLs, you need to go to the General Settings
section and enable the “Include in Sitemap”
option. This option allows you to include custom URLs and have them automatically manifested in the sitemap file.
After enabling this option, you can add the desired URLs in the relevant section and save the settings. By doing this, your desired URLs will be automatically added to the sitemap.xml file, and search engines will be able to easily access them.
This method can help you positively impact the indexing of your custom pages in search results, thereby increasing the likelihood of attracting traffic through search engines.
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://example.com/custom-page</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Note 1: The tag <urlset>
indicates the beginning of the sitemap.xml
file and includes the necessary namespaces.
Note 2: The tag <url>
specifies a new URL that should be added to the sitemap.
Note 3: In the tag <loc>
, the address of the custom URL you want to add is provided.
Note 4: The tag <lastmod>
indicates the date of the last update of the URL.
Note 5: The tag <changefreq>
tells search engines how often this page changes.
Note 6: The tag <priority>
indicates the priority of this page relative to other pages on the site.
Note 7: The tag </url>
marks the end of the custom URL.