Adding an HTML sitemap page to your WordPress website can help improve navigation and accessibility for users and search engines. Here’s how you can create and add an HTML sitemap page in WordPress:
Install a Plugin (Optional)
You can use a WordPress plugin to generate an HTML sitemap automatically. Popular options include “WP Sitemap Page” and “Simple Sitemap.” Install and activate the plugin of your choice from the WordPress plugin repository.
Create a Custom Page Template (Manual Method)
If you prefer not to use a plugin, you can manually create a custom page template.
Navigate to your WordPress theme directory via FTP or cPanel File Manager.
Create a new PHP file and name it something like `sitemap-template.php`.
Open the newly created file in a text editor and add the following code:
<?php
/*
Template Name: HTML Sitemap
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<h1>HTML Sitemap</h1>
<ul>
<?php wp_list_pages('title_li='); ?>
</ul>
</main>
</div>
<?php get_footer(); ?>
– Save the file.
Also Read: How to Create an XML Sitemap: Tips & Best Practices
Create a Page Using the Template
Go to your WordPress dashboard and navigate to Pages > Add New.
Enter a title for your HTML sitemap page (e.g., “Sitemap”).
In the Page Attributes section on the right side, select the “HTML Sitemap” template from the Template dropdown menu.
Click the Publish button to create the page.
Customize the HTML Sitemap Page
You can customize the appearance and content of your HTML sitemap page by modifying the template file or using CSS.
Add the Page to Your Website
After publishing the HTML sitemap page, you can add it to your website’s navigation menu or link to it from other pages or footer sections.
Test and Review
Test the HTML sitemap page to ensure that all links are displayed correctly and that it functions as expected.
Make any necessary adjustments to the layout or content based on user feedback and usability testing.
By following these steps, you can create and add an HTML sitemap page to your WordPress website, improving navigation and accessibility for your visitors.
Leave a Reply