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.
Copy the code below and paste it in the functions.php file.
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');
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;
}
a. Removing the codes
This method is tedious and can end up damaging your theme. So, before you proceed ensure you back up your theme first.
b. Editing the 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.
There are some plugins that can help you remove dates from your posts.
Victor Mochere is a blogger, social media influencer, and netpreneur creating and marketing digital content.
This site uses Akismet to reduce spam. Learn how your comment data is processed.
If you want to get published on victor-mochere.com, please send us your article using this form.
If there’s a topic you want to see published on victor-mochere.com, please send it to us using this form.
We are committed to upholding our editorial standards, including accuracy. Our policy is to review each issue on a case by case basis, immediately upon becoming aware of a potential error or need for clarification, and to resolve it as quickly as possible. If you notice an error or typo that needs correction, please don’t hesitate to contact us for immediate action.
Permission to use quotations from any article is granted subject to appropriate credit of the source being given by referencing the direct link of the article on Victor Mochere. However, reproducing any content on this site without explicit permission is strictly prohibited.
Our content is reader-supported. This means if you click on some of the ads or links on this website, then we may earn a commission.
Victor Mochere is one of the biggest informational blogs on the web. We publish well curated up-to-date facts and important updates from around the world.
© 2022 Victor Mochere. All rights reserved.
© 2022 Victor Mochere. All rights reserved.