Your current query will select posts that have a value in the key event_announced
which does not equal on
. What I think you want is NOT EXISTS
, and you can omit value
, since you are querying for posts that don’t have the key, hence, it will have no value. Note that NOT EXISTS
is only available in WordPress 3.5+
Related Posts:
- Meta Query Filtering not working on Custom Meta Box using Radio Buttons
- loop through custom post-type with two meta_keys
- Custom Post Type + Custom Meta Query Not Showing 2012 Posts
- Help Creating a Slideshow Custom Post Type with Custom Meta Boxes?
- meta_query for keys that aren’t yet set
- Custom Post Type – Taxonomy Dropdown Menu?
- How can I add a column/s to wp_posts table?
- echo value from ‘select’ field type into page template using cmb2?
- order by meta_value serialized array
- Order custom posts by a date metabox
- How to sort CPT by custom meta value (date), and return posts month by month
- Use Custom Post Type as Custom Field
- Saving multiple Metabox contents
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- Comparing timestamps in meta query doesn’t work
- Display two post types ordered by two custom fields
- add_meta_box: Datepicker like the one for postdate?
- How loop through posts based on custom fields
- how to set default value for checkbox in wordpress
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Display custom post types with custom date field value (before today) & order by custom date field
- Displaying Metabox value (custom post type taxonomy)
- Dynamically add / duplicate custom meta in custom post types
- WordPress custom meta field for custom post not storing data
- meta_query compare >= not working but
- How to Duplicate (multiple meta box)?
- window.send_to_editor and jQuery .attr() conflicts with multiple custom upload image meta boxes
- advanced search forms with 3 input text and that the main problem 3 input text
- List of Posts in a Custom Field
- Save an array from drop-down in custom meta box
- Pull a post based on a meta value in a custom post type
- Adding dropdown select meta box to custom post type – seems restAPI is interfering
- WP_Query: include custom post type only with specific meta value
- Keep display metadata value on backend – Custom Metabox
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- wp_query check if integer exists in custom field’s array
- Filtering custom post type on a combination of custom taxonomies and custom fields?
- Why is my select meta data not saving?
- dynamically add a custom field or metabox to custom post type [duplicate]
- Visual editor issue by having multiple tiny mce editors in a CPT
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Meta Query Not Returning Output Despite Having Matching Values
- Grouping metadatas into one
- Repeatable Fields Metabox with Textarea (or wp_editor)
- How to use TinyMCE Editor for one of my custom post meta field?
- Meta Query posts not showing on ending date of custom field
- Adding Page Templates to post but it ignored it
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- How to Output which matched meta_keys were found from custom_type_posts?
- Possible to filter custom post type with multiple meta data?
- filter search custom field query
- Permalinks: custom structure for taxonomy – tags?
- How to let users choose where to search for posts?
- Query based on custom fields start and end date
- Custom “radio button meta box” not saving correctly
- Add additional field to custom post_type
- Custom Post Meta from custom metaboxes is randomly being deleted
- Add a custom meta box for client to order CPT posts how they want
- Display Repeatable Meta Box Content
- create custom meta box with default value
- What do the numbers mean at the end of add_action(‘save_post’)…?
- A meta box (in a custom post type) with two different type of fields
- Custom Query: If One Post Object Field Value Is The Same As Another
- Reusable metabox backend and frontend
- Get custom term meta problem on single post type
- How can I output WPAlchemy repeating fields meta values in my page template?
- How can I modify a custom post type and custom page template for a child theme if all content seams to be handled by theme’s ‘native’ plugin?
- WP_Meta_Query object with conditionals
- Adding an extra parameter [string] to my posts’ permalink?
- Add a class to post_class if more than one post shares same meta_value_num
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- order the meta query results by 2 custom fields
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Using OR relation in meta_query to check for a value before sorting by another
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- Custom Metabox Info Not Saving
- Meta query and compare “!=” not working as expected
- Show posts from WP Custom Post Type selected from a field in a metabox
- PHP Warning with Custom Fields
- meta query multiple values for the same key
- Problem with multi checkboxes value in metabox?
- Sort custom post archives by a meta value from a different custom post type?
- Custom post types – meta_query: search lesson which starts sooner
- Simple Data picker meta box
- Meta_Query refuses to return results
- check_admin_referer not working in custom meta box for custom post type
- How to shows CPT which has specific meta key?
- Query events post type after current date and timezone
- Avoid another meta box in my custom post type
- Delete custom post type metadata without deleting the post in admin area
- Search form to find custom meta box generated data
- Selecting posts older than the current Unix epoch timestamp
- Unable to get the upcoming events for custom post
- Textarea type on one field custom add_meta_box?
- Custom meta box includes
- Display div based on Group metabox selection [closed]
- Get Posts ordered by a date custom meta field
- Check for custom field value in different post type than current one and do something