📲 Download Our Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

How to create sitemap in WordPress without plugin

HTML sitemap designed for Users, where user can easily view all links, pages category of the site. to create HTML sitemap for your WordPress website. follow below steps.

Step 1: Open functons.php file from theme

In First step you have to do is open your currently active theme from wp-content/theme folder. In that folder you will see many php pages. like header.php, footer.php, functions.php etc. So open functions.php file in your text editior.

step 2: Download below code and paste into functions.php

You can download source code from Github and paste into functions.php add_shortcode(‘sitemap’, ‘html_sitemap’); add_shortcode() is WordPress built-in function for shortcode tag. This function requires two parameter first your shortcode and second name of your php function during execution. you can use your shortcode on page or post like [your_shortcode_name].

Step 3: Add new page from wp-admin

Now in the last step we have to do is create new page form your wp-admin panel and Give appropriate name. In this tutorial am giving page name sitemap and paste shortcode [sitemaps] and save.

Now your site is ready with Dynamic HTML Sitemap. Whenever there is new page or post published, the link of that post/page will automatically listed in sitemap.

How to create XML Sitemap

XML Sitemap generally designed for search engines to crawling and indexing our web pages and to do that first we have to create XML sitemap and we have to submit our XML sitemap to Webmaster Tool. Follow below steps to create XML sitemap.

Step 1: Open functons.php file from theme

In first step again we have to open functions.php file in your text editor from your theme folder (wp-content/themes/your_theme_folder/functions.php).

Step 2: Download below code and paste into functions.php file

Just download and copy-paste code into your functions.php file.

add_action(“publish_post”, “XML_sitemap”); add_action(“publish_page”, “XML_sitemap”);

In downloaded file, you will see above 2 lines in that file. Here, add_action() hooks or call on a specific action. This function takes two parameter, first is the name of the action and second parameter is the name of function you wish to be hook.

For e.g : In above code we pass first parameter publish_post. So whenever you will publish your new post at that time WordPress will call a custom php function XML_sitemap which we passed as second parameter to hook.

Now new page or post published on your site, this code will clear older content and write new content in existing file. Check your sitemap by www.mydomain.com/sitemap.xml, you will see updated XML sitemap of your site.

WRITTEN BY

Rohit Gilbile




Leave a Reply

AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes