If you maintain a website whose contents are not time oriented, for instance in a non-blog context, you may want to give the dates. Publication dates might give the impression that your content is old and outdated. There many ways you can use to remove the publication or modified dates from your WordPress website. Here we are going to highlight the simplest and quickest ways to achieve that without having code knowledge or straining that much.
There are many plugins available in the WordPress repository that remove dates from posts. For many, this is an easy way out. However, some people may not want to use more plugins on their WordPress website.
Copy the code below and paste it in the Additional CSS section.
.entry-meta {
display: none;
}
Or you can try the code below.
.entry-meta .entry-date.published {
display: none;
}
This method is only suggested to those who are well versed in editing WordPress files.
a. Functions file
Before using this method, ensure that you maintain a complete documentation and backup of your WordPress website.
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');
If the above code doesn’t work, try replacing it with the one one below which is more ‘aggressive’.
function jl_remove_post_dates() {
add_filter('the_date', '__return_false');
add_filter('the_time', '__return_false');
add_filter('the_modified_date', '__return_false');
add_filter('get_the_date', '__return_false');
add_filter('get_the_time', '__return_false');
add_filter('get_the_modified_date', '__return_false');
} add_action('loop_start', 'jl_remove_post_dates');
b. Removing content file codes
This method is tedious and can end up damaging your theme. So, before you proceed ensure you back up your theme first.
c. Editing function calls codes
This method is tedious and can end up damaging your theme. So, before you proceed ensure you back up your theme first.
Published on
Surround the function calls with php comment markers (/* and */); as shown below.
Published on
Your theme may leave “Published on” output. You can proceed to delete “Published on” from the content.php file of your theme.
Victor Mochere is a blogger, social media influencer, and netpreneur creating and marketing digital content.
© 2023 Victor Mochere. All rights are reserved.
© 2023 Victor Mochere. All rights are reserved.