You can choose any method to update the last modified date with current date.
- Without a WordPress Plugin
- With a WordPress Plugin
- Manually Update each post 1 by 1
Without a WordPress Plugin:
Add the following code to your theme’s functions.php
file or use a custom functionality plugin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | function update_all_pages_with_current_date() { $args = array( 'post_type' => 'page', 'posts_per_page' => -1, ); $pages = get_posts($args); foreach ($pages as $page) { $page_id = $page->ID; wp_update_post(array('ID' => $page_id)); } } add_action('init', 'update_all_pages_with_current_date'); |
With a WordPress Plugin:
- Install and activate a plugin like “Bulk Page Updater” or “Bulk Page Edit.”
- Go to the plugin settings.
- Select the pages you want to update.
- Set the new modification date to the current date.
- Save the changes.
Manually Update each post 1 by 1:
- Go to your WordPress dashboard.
- Navigate to “Pages.”
- Edit each page individually.
- Change the “Last Modified” date to the current date.