WordPress: Remove Date From Posts on Category Page

The first thing you will need in order to remove the date from category pages is the id of the category which you wish to hide the dates on. To get the id click on ‘Categories’ in the admin and then click on the actual category you wish to affect. In the url you will see the id, similar to this:

In this instance, our ID is ’42’. Next you will need to find the file that you need to add the code into. By default WordPress will look in


for the file in this order:

  1. category-slug.php (Note: available with Version 2.9)
  2. category-ID.php
  3. category.php
  4. archive.php
  5. index.php

Once you have found the appropriate file modify it like so around line 53 near the h2 tag:

	$count = count($cat_array);
        for($i=0 ; $i < $count; $i++){
            $cat_id = $cat_array[$i]->cat_ID;
	    if ($cat_id == 42){
	        $show_date = false;
if ($show_date) {?>

Be sure to replace the number on this line

 if ($cat_id == 42)

with this ID from above.
If you wish to hide the date on individual posts, you can add the same code to ‘single.php’

2 responses to “WordPress: Remove Date From Posts on Category Page”

  1. I’m just commenting to let you understand what a awesome experience my friend’s daughter encountered studying yuor web blog. She realized plenty of details, which included how it is like to have an amazing coaching nature to make many people without difficulty grasp several hard to do issues. You truly did more than my expectations. I appreciate you for offering these priceless, healthy, explanatory and unique guidance on your topic to Sandra.

Leave a Reply

Your email address will not be published. Required fields are marked *