WordPress Tutorial: Create WordPress Sitemap Page Without Plugin
This is a super simple and quick guide to help you create a WordPress Sitemap without using a plugin. No plugin required at all!
Why would you want to not use any third party plugins to create a sitemap?
It’s really simple. All WordPress websites created by the average user should look to maintain a fully functioning site with somewhere around ~10 front facing plugins. For reasons such as speed, flexibility, security and compatibility. Some plugins which are not secure can leave your website vulnerable, they can also be incompatible with other plugins resulting in your website not loading and producing errors, and the third reason because of speed, some plugins are bulky and overloaded with code.
Oh, and most important of all it is actually super simple to do if you follow these easy instructions below. So, pull up your sleeves you’ve got to get stuck in and learn how to create a WordPress Sitemap without using a plugin
Create WordPress Sitemap without Plugin
Before you start – You need to have administrative access to your WordPress site and FTP access. You should also always take a full database and theme file backup before making any changes.
1. Go to your theme folder
2. Create and name a file page-sitemap.php
3. Paste the code below into the page-sitemap.php file
4. Create a new page in the backend of your WordPress install. Select the page template “Sitemap”
5. Now tweak to fit your site
WordPress Sitemap Page Code
Below is the original sitemap file. This supports posts, pages and WooCommerce products. If you don’t want or need WooCommerce products support then just delete the WooCommerce loop at the bottom (I’ve annotated this section so should be easy to find).