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?
- Using meta_query, how can i filter by a custom field and order by another one?
- meta_query for keys that aren’t yet set
- Custom Post Type – Taxonomy Dropdown Menu?
- WP_Query orderby custom field then post_date in one query
- How can I add a column/s to wp_posts table?
- Filtering a WP_Query meta_query by numeric values isn’t working
- echo value from ‘select’ field type into page template using cmb2?
- Querying custom post type with 2 custom fields (date-range)
- How Can I save multiple records in same meta key?
- How to get custom metabox image field?
- Detect meta value changes when post is updated (post_updated)
- Custom field being erased after autosave
- order by meta_value serialized array
- Order custom posts by a date metabox
- How to select one major category (or custom taxonomy) for a custom post type?
- 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
- Metabox saving values
- 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?
- Displaying Meta Box Image
- Multiple information using custom post type
- 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
- Display custom post on home page based on a metabox selection
- Displaying Metabox value (custom post type taxonomy)
- Filtering by Post Meta Custom Fields – Performance
- Why do I lose the content of meta boxes when I leave the page?
- 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
- Populate Custom Fields 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
- Returning a list of custom post types excluding those without a 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?
- How to check if user meta field is empty in conditional else statement
- wp_query check if integer exists in custom field’s array
- 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
- Cannot save CPT meta box
- 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
- Getting a custom post’s custom field based on another custom post’s custom field select
- 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
- Display custom meta on page that has been check in custom 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?
- Problem On Retrieving Post Meta Data on Custom Column [closed]
- 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?
- Saving metabox keys and storing values as array
- 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
- How to avoid duplicate posts queried from custom meta?
- Custom Metabox Info Not Saving
- Meta query and compare “!=” not working as expected
- Orderby if between two meta fields
- Show posts from WP Custom Post Type selected from a field in a metabox