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”
- Optimizing AJAX Query with Large Database
- When to use WP_query(), query_posts() and pre_get_posts
- order by numeric value for meta value
- Wp get all the sub pages of the parent using wp query
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Return only Count from a wp_query request?
- How to query for most viewed posts and show top 5
- How to use the_posts_navigation for wp_query and get_posts?
- meta_query: using BETWEEN with floats and/or casting to DECIMAL
- WP_Comment_Query pagination, delving into the unknown
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Get posts from Network (Multisite)
- How to order by post_status?
- Using get_posts vs. WP_Query
- Delete all posts from WordPress except latest X posts
- Make a WP Query search match exactly the search term
- WP_Query: query posts by ids from array?
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Sanitation needed for WP_Query or get_posts calls?
- Differences Between WP_Query() and get_posts() for Querying Posts?
- Sort posts by category name and title
- How to uniquely identify queries?
- Should I use Transients with W3 Total Cache APC Caching? [closed]
- What is the most efficient way of querying posts based on visits and date for current day?
- Add indexing to meta_value in wp_postmeta
- Get Recent Posts by Date in Multisite
- Custom WP_Query order by post_meta and (author) user_meta
- get_posts with multiple categories
- Query WooCommerce orders where meta data does not exist
- get_template_part in for loop
- Use of caller_ get_ posts
- WP_Query for WooCommerce Products
- pre_get_posts with get_posts
- How-to exclude terms from the main query the most performant way?
- Get posts by menu ID
- Is it possible to select against a post’s parent’s fields with WP_Query?
- How to know if get_posts() failed?
- Query all posts where meta value is empty
- author.php with ACF and CPTs
- Slow SQL_CALC_FOUND_ROWS Query
- Query Custom Meta Value with Increment
- Export wordpress table to excel
- When should you use wp_reset_postdata vs wp_reset_query?
- Identify which loop you are hooking into; primary or secondary?
- Get_post() with meta_key when compare is a date
- Perform query with meta_value date
- WP_Query ordered by custom field that is a date string?
- get_posts not finding argument: post_name
- Meta Query with date and time on the same Day before given time
- How to make an activities stream mixing posts and comments?
- Duplicate Queries
- Get posts with condition on comment meta value
- How to query for a week using key => value WP_Query argument notation?
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- What is an efficient way to query based on post_meta?
- Show only oldest post by author
- Order posts by tags count?
- SQL query equivalent to WP User Query
- Function to check if author has posted within the last x days
- Add and in the header while looping over custom query in page template
- How to get the posts published in last two days using WP_Query?
- Highlighting Sub topic in a post?
- Use post__in and post__not_in together?
- Which custom query am I in and how can I access its properties & methods?
- How to count post type that has a particular term?
- What should I use, get_posts or wp_query for less CPU load?
- Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
- How to get post from all Blog Multisite to the Main Site?
- Finding the next 5 posts
- how to retrieve specific product attribute value in an sql query?
- WP Query post meta value
- Get all posts without tags
- Dynamically Override Fancy Title – Part II
- Transient pagination not working properly
- Foreach-generated custom tax queries, each with an ajax “Load more” button
- get_posts() seemingly ignoring post_type
- How to find out what “Blog pages show at most” is set to [duplicate]
- view queries made?