How to Remove Posting Date from WordPress Default Themes

Remove the Post Date in WordPress, FixMyWP guide header image

There are times when we don’t want the posting date to show on our WordPress posts or pages. If you are wondering how to remove the date from a WordPress post, there are two ways to do it: the CSS way and the functions.php way. Both are applied in a child theme, because it’s not wise to edit the parent theme itself. In the guide below I’m going to use the latter one.

How to remove the WordPress posting date using Child Theme Functions.php

Remove Posting Date from Twenty Eleven Theme

Open the functions.php file of the Twenty Eleven Child Theme and between

				
					<?php
?>
				
			

insert the following:

				
					if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post-date/time and author.
 * Create your own twentyeleven_posted_on to override in a child theme
 *
 * @since Twenty Eleven 1.0
 */
function twentyeleven_posted_on() {
	printf( __( '<!--<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time>--></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
		esc_url( get_permalink() ),
		esc_attr( get_the_time() ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() ),
		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
		esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
		get_the_author()
	);
}
endif;
				
			

Remove Posting Date from Twenty Twelve Theme

Open the functions.php file of the Twenty Twelve Child Theme and, between the opening <?php and closing ?> tags, insert the following:

				
					function twentytwelve_entry_meta() {
	$categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
	$tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
	$date = sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
		esc_url( get_permalink() ),
		esc_attr( get_the_time() ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( get_the_date() )
	);
	$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
		esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
		get_the_author()
	);
	if ( $tag_list ) {
		$utility_text = __( 'This entry was posted in %1$s<!-- and tagged %2$s on %3$s--><span class="by-author"> by %4$s</span>.', 'twentytwelve' );
	} elseif ( $categories_list ) {
		$utility_text = __( 'This entry was posted in %1$s<!--  on %3$s--><span class="by-author"> by %4$s</span>.', 'twentytwelve' );
	} else {
		$utility_text = __( 'This entry was posted<!--  on %3$s--><span class="by-author"> by %4$s</span>.', 'twentytwelve' );
	}
	printf(
		$utility_text,
		$categories_list,
		$tag_list,
		$date,
		$author
	);
}
				
			

Theme not behaving? Broken layouts, failed theme updates or style changes you can’t get right. We fix them for a flat $249. See theme fixes →

Cover of the free WordPress Cleanup Guide from LeDetailWP

Free guide from LeDetailWP

WordPress Cleanup Guide

Declutter your WordPress site, clear out what slows it down and find the free plugins that keep it running smoothly.

Get the free guide →

★★★★★
My theme broke and I could not fix it myself. I contacted fixmywp.com and they had me up and running under 24 hours.
Mark Ballenger
applygodsword.com

Remove Posting Date from Twenty Thirteen Theme

Open the functions.php file of the Twenty Thirteen Child Theme and between

				
					<?php
?>
				
			

insert the following:

				
					if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
/**
 * Prints HTML with date information for current post.
 *
 * Create your own twentythirteen_entry_date() to override in a child theme.
 *
 * @since Twenty Thirteen 1.0
 *
 * @param boolean $echo Whether to echo the date. Default true.
 * @return string The HTML-formatted post date.
 */
function twentythirteen_entry_date( $echo = false) {
	if ( has_post_format( array( 'chat', 'status' ) ) )
		$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
	else
		$format_prefix = '%2$s';
	$date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
		esc_url( get_permalink() ),
		esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
	);
	if ( $echo )
		echo $date;
	return $date;
}
endif;
				
			
Download Twenty Thirteen Child No Posting Dates Theme

Feel free to post a comment if you have any questions.

Theme not behaving?

Layouts out of place, a theme that won’t update or install, or small style changes you can’t get right. Flat rate of $249, usually done the same day or within 24 business hours.

See theme fixesNot sure? Answer 4 quick questions

In this article

Need a hand with your site?

Answer four quick questions and see your flat price before you pay. Most fixes are done the same day or within 24 business hours.

Related articles