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
First of all, you need to create a child theme for each of the WP default themes. You can
follow this guide in order to create child themes for any of the WordPress Default Themes, Twenty Eleven, Twenty Twelve or Twenty Thirteen.
Remove Posting Date from Twenty Eleven Theme
Open the functions.php file of the Twenty Eleven Child Theme and between
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( __( ' by %7$s', '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( '',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$author = sprintf( '%3$s',
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 by %4$s.', 'twentytwelve' );
} elseif ( $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s by %4$s.', 'twentytwelve' );
} else {
$utility_text = __( 'This entry was posted by %4$s.', '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 →
My theme broke and I could not fix it myself. I contacted fixmywp.com and they had me up and running under 24 hours.
Remove Posting Date from Twenty Thirteen Theme
Open the functions.php file of the Twenty Thirteen Child Theme and between
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( '',
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;
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.

