As you all know how important is a sitemap for a blog so that your visitors can find articles easily.You can install a plugin that will create the site map but if you do not want use plugin then you can create a template file and use to create a sitemap

For google sitemap there is this Google XML Sitemaps plugin that will create xml file and submit to google and bing.the xml file help search engines to index your wordpress more easily but for humans a sitemap will be very helpful and in addition help inbound links to your wordpress.

How to create template for sitemap

Copy page.php file from theme folder and paste it in a editor like Notepad++
Look for this code

<?php the_content(); ?> 

and replace with the code below

<h3>Pages</h3>
    <ul><?php wp_list_pages("title_li=" ); ?></ul>
<h3>Feeds</h3>
    <ul>
        <li><a title="Full content" href="feed:<?php bloginfo('rss2_url'); ?>">Main RSS</a></li>
        <li><a title="Comment Feed" href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comment Feed</a></li>
    </ul>
<h3>Categories</h3>
    <ul><?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0&feed=RSS'); ?></ul>
<h3>All Blog Posts:</h3>
    <ul><?php $archive_query = new WP_Query('showposts=1000&cat=-8');
            while ($archive_query->have_posts()) : $archive_query->the_post(); ?>
                <li>
                    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
                 (<?php comments_number('0', '1', '%'); ?>)
                </li>
            <?php endwhile; ?>
    </ul>  

<h3>Archives</h3>
    <ul>
        <?php wp_get_archives('type=monthly&show_post_count=true'); ?>
    </ul>

and at top the page replace template name so that you have

<?php
/*
Template Name: Sitemap
*/
?>

Once you have made the changes save the file as sitemap.php and upload the file in your themes folder.

Now log in admin panel and and create a page name Sitemap or any other name you want.

On right Page Attribute box select sitemap and publish No content as the content will be displayed from database.

Check if you have a sitemap page with all links to your pages and posts.

Avatar of Govindji Patel

About

I am Author/Publisher WordPress Coach and Consultant who enjoys writing tutorials and helping wordpress users build better WordPress website/blog.

Related Posts

blog comments powered by Disqus
Premium wordpress theme
Skype Status
Need Help with Wordpress Chat with me - Govindji Patel: My status is Online
» Get Skype, call free! If Offline please leave Message
Become A Fan
Free Report

WordPress Optimization Secrets

Get Your Blog To Rank Higher

Register and Download Free Report

Twenty Eleven Child Theme

Upgrade and get set of 35 videos on

how to create and customize child theme

Buy Me Coffee
Donation



Other Amount:



I appreciate a donation if you find my tutorials helpfull :



Your privacy will never be compromised or shared.
Congratulations

Thank you for Subscribing Please check your email for a confirmation email