How to Remove the Date from WordPress Pages

For some reason my WordPress install didn’t go quite as well as others. As I mentioned in my how to get permalinks working post, some files were omitted from my admin page and also from my WordPress folder. Well, another few hours spent searching the WordPress support forums and I was able remove the date and headers from my individual pages in my WordPress blog. These are pages like about me, contact me, support, etc. The following is how to quickly and easily remove those items.

What Page Template am I using

First off you should know that each page of your blog has a specific template used for it that can be edited. In the WordPress admin page navigate to the Presentation button on the top of the page. Then click on the Theme Editor button. This will bring you to all the theme templates that you can edit using your admin page. If you see one labeled Page Template on the right hand side then great, you can jump to the next step. If not then you must create one. As mentioned in this wordpress codex, WordPress by default will go to index.php as the template to use for all pages if there isn’t first a page specific template, or a general page.php template. It will follow that order to find one, page specific->page.php->index.php.

Therefore, if you don’t want the date to show up within these pages you must make sure a page.php template is in the themes folder. To do this use your ftp client (such as Filezilla) to get to where your themes folder is. My themes folder was located in the wp-content folder. Once there copy the file named index.php. (Remember it must be the file from the themes folder.) Next, paste it to your desktop and then rename it page with the same file extension php. Therefore it becomes your page.php template. Finally paste it back into your themes folder using your ftp client.

Now, when you go to the Theme Editor in the Presentation tab you should see Page Template as one of your options. Super!

Removing the date from the Page Template

Once you are able to see and edit the Page Template using your WordPress admin page go there and open it up (if you’re following along from the last step you should already be there.) Within the Page Template there is a portion of code that should say <!– S T A R T M A I N C O N T E N T –>. Following that there should be somewhere the following lines of code:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_date(”,’<h2>’,'</h2>’); ?>
<div class=”post”>
<h3 class=”storytitle” id=”post-<?php the_ID(); ?>”><a href=”<?php the_permalink() ?>” rel=”bookmark”>
<?php the_title(); ?>
</a></h3>
<div class=”meta”>
<?php _e(“Category:”); ?>
<?php the_category(‘,’) ?> — <?php the_author() ?> @ <?php the_time() ?>
<?php edit_post_link(__(‘edit post’)); ?>

The portion you should erase to get rid of just the date is <?php the_date(”,’<h2>’,'</h2>’); ?>. If you want to get rid of the whole header from the top of your individual pages then delete everything that I have showed you above. This will leave just the title of the page and the content. Navigate to some of my individual pages like About Me to see how this looks.

Done! Once you get the hang of whish php calls do what you can delete more of them to further customize your page. Good luck and remember, if things get too screwed up and you can’t remember what you deleted or added you can always just delete the page.php file from your themes folder and start over.

2 Comments

  1. Wow cheers buddy. This was so easy. Thanks!!!

  2. Thanks. What a simple procedure!

Leave a Comment