How to Create Sitemap in WordPress

As a website developer, you need to know certain aspects involved in the SEO. Not just as posting and publishing the post or some news in your blog, you have to know about website maintenance, search engine optimization techniques, stuff and much more!

Likewise, Sitemap is one of the most important things you have to clear about it. You may hear about Sitemap on some other sites or discussed your third-party bloggers. So what is a Sitemap? Why do websites having Sitemap? Whether we need it for your site? What’s good, if you have it in your portal? All these will be discussed one by one in this post.

Before continuing with the exact the steps of creating Sitemap in your WordPress Sites, we will give you with some general concepts of the sitemap.

What is a Sitemap?

Simply saying, the Sitemap is a file that content the number of posts, attachments, pages, and media is on your website. It is a collection of links to all the pages or post in your portal. Today, Sitemap is published in both HTML and XML formats.


The XML is designed for search engine crawler to crawl deeply whereas HTML is created for human to navigate page quickly and easily. Having it in your web portal is quite useful to you, where it assists search engine bots to crawl the web pages of your site.

Why do you need it???

If you wish the search engine bots to crawl the pages in your portal, then Sitemap makes the entire process much easier. It provides the search engine bots with an easier choice to crawl your web pages. Therefore, if your site doesn’t have a sitemap then create it by the day. It helps to search engine crawler to crawling your blog in an efficient manner.

The sitemap offers an edge to your portals and you may promote your web pages visibility in search engine. Hence, it affords an excellent chance to stay in good touch with the search engine.

Therefore, do you like to have a Sitemap in your website? The answer is YES

Okay fine guys, shall we move on how to create a sitemap for your WordPress website…

How to create Sitemap in WordPress without Plugins

To create HTML sitemap for your portal, follow the below steps:

Html sitemap is crafted for the users, where they can find easy to view all the links, pages category and more of their sites.

Step 1: First you need to open your presently active theme from theme folder. In that there are many .php files are like footer.php, functions.php, header.php and so on. Open functions.php file in your text editor.

Step 2: In the text editor copy the below code and paste it into functions.php

add_shortcode(‘sitemap’, ‘html_sitemap’);

Step 3: Finally, create a new page from your wp-admin panel and provide an appropriate name and save it.

That’s it! Now your website is ready with html sitemap. Whenever you add any new page or post, the link of that will be automatically listed in sitemap.

To create XML sitemap for your website, kindly go by the step by step process given below:

Basically, XML sitemap is created for the search engines to crawling and indexing the web pages. For this, you need to create XML sitemap and then submit it to webmaster tool.

Step 1: As we said in the above html sitemap, open the functions.php file in the text editor from your theme folder or wp-content folder


Step 2: Just copy the below code and paste it into your functions.php file

add_action(“publish_post”, “XML_sitemap”);

add_action(“publish_page”, “XML_sitemap”);

Any new page or post published on your portal, it will clear the older content and update the new content in existing file. Check out your sitemap via, you can see the updated xml sitemap of your website.


How to Generate Sitemap using WordPress Plugins

You may ask that the sitemap plugins are very effective? Of course, WordPress developers are usually prefer these easy facilities of generating sitemap for their sites. There are many sitemap plugins are available for, where you can create a dynamic sitemap whenever you updated with fresh post or content or page on you portal.

What you have to do is? You have to go the best-suited sitemap plugin for your web page either for free or for fewer prices. Then continue with the below process,

Process 1: First download any of the WordPress plugin that will generate sitemap

Process 2: Do one time setup of sitemap in wp plugin

Best WordPress Sitemap Plugins for your Websites

Giving importance to it is not a surprising one because most famous SEO plugins tend to include the ability to generate sitemaps automatically. Here is the most popular list of WordPress plugins, which will help you to develop a sitemap for your blog or site.

Yoast SEO

With millions of active installs, Yoast SEO is one of the most and best-selling plugins. It includes some of the advanced and latest XML sitemap functionalities. Are you running a multisite network? Then you will be euphoric with this plugin, where it works smoothly in this context.


Click for Details

Google XML Sitemaps


Click for Details

All in One SEO Pack


Click for Details

Google Sitemap by BestWebSoft


Click for Details

Better WordPress Google XML Sitemap


Click for Details

Hope you will find that this post is very helpful and useful for you. If so, share it with your friends and enjoy your experience. If you have any doubts or noticed that we miss out something? Then kindly leave a comment in the below comment box.

So go ahead and create one sitemap and submit it to search console and webmaster tool….

(Visited 281 times, 1 visits today)