I’ve been using this for a while to solve exactly your issue, I think I got it from the codex somewhere. But it works.
// verify if this is an auto save routine.
// If it is our form has not been submitted, so we dont want to do anything
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
return $post_id;
Related Posts:
- Query all posts where a meta key does not exist
- Correctly delete posts with meta and attachments [duplicate]
- Storing revisions of metadata for custom post type
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How can I filter posts by post_parent in the admin?
- Ordering posts having multiple post-meta date fields
- Custom Post Type with Input fields to seperate table on database.
- How Can I save multiple records in same meta key?
- Permalinks using event date (year & month) instead of publication date
- Grossly inefficient wordpress loops!
- Creating a custom post type upon registration
- Reason action hook won’t work with update_post_meta from frontend form? Alternative?
- Showing Meta Data for Custom Post Types?
- Having trouble with custom post type / meta box
- Query for posts from any post type but only add instock products
- update custom post type meta from a shortcode
- How to make custom post meta wp_editor translatable?
- How to keep a check box in custom meta box for custom post type checked by default for add new post?
- Show metabox in custom-post-template depending on taxonomy term?
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- update_post_meta() whenever custom post type is updated
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Using date stored as custom field to filter posts displayed in admin
- How to best delete orphan wp_postmeta
- Meta Box Only in CPT Edit Page, Not in Add New
- get_template_part() – post-meta not working?
- WordPress Orderby Numeric Value Not Working
- Replace title column in post list with post meta value
- My theme saves their custom post type’s metadata as a serialized array, how to access the keys?
- Does WordPress limit the length of slug names for Post Meta or Terms?
- Populate Custom Fields in a Custom Post Type?
- Insert Multiple Post with Same Publish Button
- Custom meta box data array: foreach not working correctly?
- Undefined Variable – Custom Post Type Meta
- How to check if user meta field is empty in conditional else statement
- Post image in WordPress not appearing on home page
- changing meta value and meta key of price field
- Posting to a Custom Post Type from front end – user generated content
- Getting meta in editor plugin, and event triggering issue
- Should wp_postmeta meta_key always be unique for a given post_id?
- Metabox not show in categories custom post type cmb2
- Custom fields for custom post type
- Show future events based on custom field AND order by date
- Is there a way to exclude posts based on meta_values?
- Submitting Custom Post Types with custom fields from Front-end form
- How to Echo Metadata Value in Currency Format
- Issue on Working with Metabox – Checkbox to enable Sale Items
- Filter posts by tax (dropdown) and meta value
- Publish and save specific postmeta to a filtered post_type
- How to move a post to different post type with all meta data?
- Why do I have to press the “Update” button twice to save my meta box values?
- WP API Response does not show my registered metadata
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- Batch Extract Date from post title and put into ACF custom field
- How to handle this specific case of custom post type?
- Save CTP post meta different values each day without overwriting previous values
- get_post_meta returns NULL in front-end, but correct result in back-end
- Problem with adding custom post type meta to header by plugin
- Meta box data is saved but NOT displayed in the meta box text field. Why?
- How to call a post’s metadata in shortcode.php?
- WP_Meta_Query object with conditionals
- Trying to write shortcode with get_post_meta but isn’t working
- Sanitaizing Select Optin For Custom Post Type Metabox in WP
- HM CMB: Post Select Field for CPT ID
- Getting WordPress to store 0 values for custom post type meta
- updating one custom meta field only
- Problem Saving Custom Post Type Meta Values
- Get_post_custom not fetching value from array wordpress
- Save data is post using php front end
- Creating a custom post type upon registration for a specific user role
- How to sort by multiple values in a nested WP_Query
- Show posts from WP Custom Post Type selected from a field in a metabox
- Where is get_post_meta value located?
- How do I create a customised table list of a custom post type (in the admin area)?
- Saving custom post types post_meta over REST-API fails
- add action save post type and update post meta woocommerce
- get_post_meta not working with variable as a post_id for dynamically get the postid
- How to save post_status using action save_post?
- Custom post meta box as a sub form
- Metaboxes in Loop
- Add more custom fields when creating a new custom post type
- Custom meta box data not saving
- Collect custom post in a calendar
- Storing data in a multidimensional array from dynamically generated foreach loop
- Edit is changing my custom’s post type parent id
- Disable Facebook Comments Automatically On CPT
- Problem with ‘save_post’ hook not running
- WordPress custom post type
- Edit post meta direct from post.php?
- Howto: use existing post_meta as options for a different metabox (checkboxes or list)
- Values inside a custom field to determine which category posts to display
- How to rewrite CPT-Permalinks the correct way (incorporating meta-box-data)?
- Advanced search form with filters for custom taxonomies and custom fields
- Top 30 Songs using Custom Post Type
- Advice Needed for Post Meta Database Efficiency
- Querying meta values within an array
- Custom post type – update_meta not working
- why get_post_meta is returning 0?
- Save post_parent in a custom post type
- Update an existing post in a custom post type