How to Remove the Date From WP
Most WordPress themes display a meta description for every blog post. The meta description gives visitors information about the posts, such as the post's author or the date and time when the post was published. The "the_date()" template tag -- a PHP function built in to WordPress for use in template files -- outputs the date when a post was published. You can remove "the_date()" to take the date from your meta descriptions. Because "the_time()" is also sometimes used to display dates, remove any date-related parameters from the function.
Instructions
-
-
1
Visit the wp-admin folder of your WordPress website, and log in to the dashboard. Navigate to "Appearance," and click the "Editor" link to load the "Edit Themes" screen. Find your index.php file under "Templates," and click its link to load the file in the editing box.
-
2
Find the code that outputs your post meta description in the template file. You can usually find this code beneath the post title or just below "<?php the_content(); ?>" or "<?php the_excerpt(); ?>". Where you find the meta description, look for "<?php the_date(); ?>", and delete that template tag. If you find "<?php the_time(); ?>" instead, remove any of the following parameters from between the parentheses if you see them: d, j, S, l, D, m, n, F, M, Y, y.
-
-
3
Edit the text in your meta description to remove any reference to the date. Click the blue "Update File" button to update the template.
-
4
Load the single.php template file in your editor box and remove "<?php the_date(); ?>" from the meta description code. Remove date-related parameters from "the_time()" template tag if you see them. Save the file, and repeat this step on any other templates that output posts, such as category.php or a custom post template.
-
1
Tips & Warnings
Add "the_time();" if you want to remove the date but keep the time. Unless you add parameters to the function, "the_time()" will use your dashboard settings to format the timestamps on your posts.
Back up your theme files before editing them. If you encounter a white screen error, re-upload your original theme files to get back into WordPress.
References
- Photo Credit Comstock/Comstock/Getty Images