The question of how to customize which post data gets updated has been answered elsewhere on StackExchange.
Here is a specific example of how to stop the modified date from being updated:
function stop_modified_date_update( $new, $old ) {
$new['post_modified'] = $old['post_modified'];
$new['post_modified_gmt'] = $old['post_modified_gmt'];
return $new;
}
add_filter( 'wp_insert_post_data', 'stop_modified_date_update', 10, 2 );
// do stuff that updates post(s) here
remove_filter( 'wp_insert_post_data', 'stop_modified_date_update', 10, 2 );
NB: It is extremely important to remove the filter when you’re done with your special tasks unless you really want the modified date to never update anywhere on the site.
Happy coding!
Related Posts:
- Verify if tag is used on posts
- How to change the case of all post titles to “Title Case”
- WordPress removing tags?
- Add tag to post api wordpress
- Set tags for a post – without tag creation
- Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg
- How to remove Nextpage tag inside posts text depending of utm_campaign
- Get title of post without using the_title();
- Plain-text tag list?
- Display posts by tag on page
- Edit a post from frontend. post_tags get saved, but not separated
- Convert IPTC keywords to blog post tags
- how to limit and display tag?
- Include related posts on a page
- How to add shortcode tags in single.php [closed]
- Remove post_tag from default post type, add custom taxonomy
- What Defines What Category A Post Picks (if in multiple)
- Testing for post title in ‘if/else’ statement returns no content
- get_post_field – Title without paragraph
- Add Category name to Post Title (h1)
- Sorting posts alphabetical that have single digits
- how to programmatically change post tags
- How to display all posts assigned to some tag?
- How To Add One Tag to Multiple Posts?
- I want to show category in the post title , how can I do
- How to display following posts titles in separate div’s on a separate webpage
- WP Query – duplicated posts once including tags in search results
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- Lose “Blog Archive” from page title
- Tags to Post-ID mysql query. Tag Search
- Display post from current category and same tag?
- WordPress not opening posts with only numbers if permalink is post_name
- Should I use posts or pages in this scenario?
- “more” tag doesn’t appear when browsing category achives or search
- Display tag image in post using Taxonomy Images plugin index.php
- Help with Taxonomies
- sql select for post_title and a term name
- how to add text to posts from tags
- How do I change the core post search algorithm? Where is it found/constructed?
- How to get Tags with specific post id
- Add title for previous and next posts to Yoko Theme
- Images inside post title
- Conditionals if tags exist?
- How To capitalize The First Letter Of Every Word In The Post Title
- How to show show the Second page title in the page
- How to get links to the last N posts in a specific category?
- Blog post not showing title
- How can I remove the first two words and shorten get_the_title()
- How do I include the category next to the title of a post?
- How to change the layout of posts when viewing all posts by tag [closed]
- Count several post tags
- How to style archive post titles… but only those posts who have comments?
- Replace image name on upload to the new post name on front-end form
- Tags on products vs tags on blog posts. An easy way to duplicate them
- Change Post Title For Specific Category
- How to remove “» (title of post or page)”?
- Removing all post tags except a given list
- Auto update post title and slug when post status is changed
- Having pages after specifying post_type post
- How to check if there are posts with the same tag
- In what context should Categories and Tags be used
- Microformats in a single post – layout conflict
- Post titles and thumbnails as links to custom post types?
- Plotting posts on a graph
- Deleting post tags removes categories
- Changing The Default Header POST Title and Description text by category in wordpress
- Change modified date to current date when title updated automatically
- What parameters do I need to pass to get_tags to get ALL tags for the site, when used in a post
- Post title not displaying as recorded in the wp_posts table
- Tag for custom post type
- WordPress get tags in “publish_post” hook
- Remove status ‘archived’ from the default post and page view
- Create/Set Category as Title of Post
- long-title posts do not want published
- Why do I have categories with duplicate slugs?
- Exclude posts in home slider from sections
- Display all tags even if they are not assigned to a post
- Please I want to prefix my WP posts title according to each category
- I really need help… I am looking for a solution about 28hours
- show only one category and filter by tag
- Post title spoiler how?
- 2 Domains, Same Content, Different Titles?
- Find post tags words in post content and link them to tag URLs
- Set multi posts random categories and tags
- Hide title in Merlin Theme on posts and pages only
- Hide Certain Tags on Single Post Page
- Display only current page -> posts tags in page
- Posts tagged with a-new-tag does not appear
- Query posts from a specific category and selected tag
- Back up post tags
- Tags not appearing in “Add New Post” Page
- How to get all post titles starting with numbers and symbols?
- Custom Post Title as search term
- Display the popular tags by default in the backend post edit page (without having to click on the link that displays them) [closed]
- Is there a way to separate wordpress titles from their posts?
- Single post pagination
- How remove “recent comments” title without modifying code? [closed]
- How to remove a specific script from bulk wordpress posts and images description?
- Tag page that displays specific posts
- Get related posts matching most of the provided tags using WP_Query