As mentioned in the comments you can query the postmeta table directly:
public function get_metadata_keys(){
global $wpdb;
$meta_query = $wpdb->get_results(
"
SELECT DISTINCT meta_key
FROM {$wpdb->postmeta}
"
, ARRAY_A );
$meta_keys = wp_list_pluck( $meta_query, 'meta_key' );
return $meta_keys;
}
This will return the list of all meta_keys associated to any post.
Related Posts:
- When should you use WP_Query vs query_posts() vs get_posts()?
- WP_Query vs get_posts
- Get posts by meta data OR title
- Can not switch the queried post in pre_get_posts hook
- WP_Query Performance Issues with meta_query
- WP_query category__in not working, only pulls from first category
- Get the post permalink within the loop but without additional DB query
- How To Get Some Data From WordPress Database Using WordPress $wpdb Query?
- Creating a custom search for a specific post type
- Weird orderby => post__in issue
- No results found from a $wpdb->get_results() query when trying to join more than one meta key query
- Check return value of get_posts
- Is it possible to query from external database? [duplicate]
- Specify strict ‘order by’ in WordPress query
- How to set up hierarchical relationships without using plugins / meta query
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- wpdb get_results() returns only 2 rows
- Ordering Posts by parent category, name ascending
- WP_Query always returning the last custom post
- When should you use WP_Query vs query_posts() vs get_posts()?
- Retrieve posts in custom post type and specific taxonomies
- A Depth Like Parameter For “get_posts”
- When to use WP_query(), query_posts() and pre_get_posts
- Return only Count from a wp_query request?
- Make a WP Query search match exactly the search term
- Get Recent Posts by Date in Multisite
- Query WooCommerce orders where meta data does not exist
- How to know if get_posts() failed?
- Query all posts where meta value is empty
- author.php with ACF and CPTs
- Identify which loop you are hooking into; primary or secondary?
- Get_post() with meta_key when compare is a date
- get_posts not finding argument: post_name
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- Show only oldest post by author
- How to get the posts published in last two days using WP_Query?
- Dynamically Override Fancy Title – Part II
- Transient pagination not working properly
- get_posts() seemingly ignoring post_type
- view queries made?
- Count posts returned by get_posts in external PHP script
- List the 5 most recent child pages
- SELECT * FROM $wpdb->posts WHERE ID > 160
- Adding multiple post queries with parent and children to page – Best Way
- How WordPress attaches its Featured Images with posts?
- Query total number of posts
- Custom query for sidebar isn’t returning results
- WP_Query() and get_posts() can’t handle over a thousand posts?
- Iterating through $wpdb query without using get_results for large query results
- Query posts intersecting tags and categories
- How to implement a new row_count method in WordPress?
- Conflict with get_posts and the_content
- WP_Query orderby and tax_query
- How to get a query variable?
- Query Page Content From Theme Options?
- Modify Search Query if original Query gave no results
- Include current post into loop
- Filter post query to only show direct children of category
- get_posts() and global variables
- how to get Nearby zipcode
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- Wpdb->query result show 1 but is not an integer
- Storing an array of objects related to each user
- wordpress udpate query not equal to
- WP Query – filtering terms with regex
- Is it possible to retrieve posts depending on meta_key LIKE condition? [duplicate]
- How to get posts by category and by choosing a taxonomy term?
- WP_User_Query orderby meta_val_num
- WP_Query custom order and pagination
- Unable to paginate a custom page query
- Execute PHP function inside the admin area
- Query pages created by deleted users
- Populate select list with meta values from all posts of a Custom Post Type
- Form checkbox value going to dynamic URL
- Exclude post from wp_query based on custom field boolean
- Get posts that match defined arrays of tags
- get_posts return only first result
- Move some posts to end of sort order, even if there is a sort in the wp_Query already
- How select query is generated in a Custom Post Type?
- Translating WP query into to SQL query
- WP_Term_Query->get_terms() very slow query for WordPress filter
- Is my code correct?
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- Meta query doesn’t remove placeholder escape before query
- get_posts query caching?
- Get posts with any value in attribute
- How can I modify standard search query to include also ACF custom fields values?
- Website goes slow down after importing long database
- How to get query results for the next page
- Loop through multiple custom fields with increasing number
- How to organize a WP_Query’s list of posts by category and display category title?
- Need help setting up a search form for wordpress [duplicate]
- confirm my booking with phone number
- Get WP_Query query after execution?
- shortcode using multiple WP_Query’s with multiple category names not fully functional
- 294 Queries on Mainpage of WordPress
- orderby and order filter in get_posts or WP_query function in wordpress not working
- Query custom post types by meta field in a term from custom taxonomy
- Search query alteration not working for meta values
- Advanced Search – Is this possible?