Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

get_post_meta slowing down my page load (in a plugin)

You should use an object cache, it will definitely speed up the get_post_meta queries as they will be cached when doing the initial WP_Query (get_posts).

I recommend testing with APC cache, using the APC Object Cache Backend : https://wordpress.org/plugins/apc/

Just drop the file in your wp-content folder and make sure you have APC extension available.

Related Posts:

  1. meta_query: using BETWEEN with floats and/or casting to DECIMAL
  2. WP Query post meta value
  3. Woocommerce: order posts by meta key
  4. When should you use WP_Query vs query_posts() vs get_posts()?
  5. When to use WP_query(), query_posts() and pre_get_posts
  6. How to only display posts whose meta_value field is not empty?
  7. Can wp_query return posts meta in a single request?
  8. order by numeric value for meta value
  9. How do I query for posts by partial meta key?
  10. Use REGEXP in WP_Query meta_query key
  11. WordPress retrieving meta data for all custom post types in list view
  12. How to use the_posts_navigation for wp_query and get_posts?
  13. WP_Query vs get_posts
  14. Order by optional meta key?
  15. Get posts from Network (Multisite)
  16. How to order by post_status?
  17. Using get_posts vs. WP_Query
  18. Delete all posts from WordPress except latest X posts
  19. Reduce or prevent calling of update_meta_cache
  20. Is there a way to extend WP_query so Custom Post Types can have properties?
  21. Sanitation needed for WP_Query or get_posts calls?
  22. Differences Between WP_Query() and get_posts() for Querying Posts?
  23. What is the most efficient way of querying posts based on visits and date for current day?
  24. Get Recent Posts by Date in Multisite
  25. get_posts with multiple categories
  26. get_template_part in for loop
  27. Use of caller_ get_ posts
  28. Getting attachments by meta value
  29. WP_Query displaying ALL posts
  30. How-to exclude terms from the main query the most performant way?
  31. Is it possible to select against a post’s parent’s fields with WP_Query?
  32. Query all posts where meta value is empty
  33. meta_query where value is equal to given value
  34. Query Custom Meta Value with Increment
  35. WP-CLI How to generate a list of posts with corresponding meta values
  36. Get posts by meta data OR title
  37. Get_post() with meta_key when compare is a date
  38. get_posts not finding argument: post_name
  39. Meta Query with date and time on the same Day before given time
  40. Get posts with condition on comment meta value
  41. What is an efficient way to query based on post_meta?
  42. WP_Query not working as expected for attachments and custom meta_query
  43. Function to check if author has posted within the last x days
  44. How to count post meta key values for all posts in database
  45. Use post__in and post__not_in together?
  46. Group posts by meta_key
  47. What should I use, get_posts or wp_query for less CPU load?
  48. How should I use posts_where to change meta_value from a string to integer?
  49. Different Results with query(‘s=computer’) vs get_posts(‘s=computer’)?
  50. How to get post from all Blog Multisite to the Main Site?
  51. How can I create a WP_Query that returns posts where one meta_value
  52. WordPress altering my custom query, How to fix it?
  53. WP Meta Query for some meta (array) values
  54. Get all posts without tags
  55. Would this post meta be better added to the post table rather than post_meta table
  56. Custom URl parameter
  57. query posts in functions.php and update a field
  58. get_posts() seemingly ignoring post_type
  59. Compile meta values from custom loop into array and then calculate sum total
  60. Can not switch the queried post in pre_get_posts hook
  61. How to get sum of meta_values of a meta_key in wp_query according to conditions
  62. how to fire join query with post_meta
  63. How to find out what “Blog pages show at most” is set to [duplicate]
  64. Count posts returned by get_posts in external PHP script
  65. Best approach to create Hot and Trending sections
  66. WP_Query, custom sort and custom filter
  67. Trying to check and see if a post has a featured image outside of the main loop
  68. WP_query category__in not working, only pulls from first category
  69. Order posts by meta value and Date
  70. SELECT * FROM $wpdb->posts WHERE ID > 160
  71. Efficient way to update multiple post meta
  72. How to make orderby ‘meta_value_num’ OPTIONAL?
  73. Query Posts depends on custom field inside repeater field using acf
  74. Adding multiple post queries with parent and children to page – Best Way
  75. How do you Query posts with nothing in common?
  76. Query post with meta_query where date is not in future
  77. WP_Query, tax_query and term_meta: How to?
  78. Minimising Database Queries when using Advanced Custom Fields
  79. Get posts for last working week in WP_Query
  80. Get meta info related to current post
  81. Select from wp_post and multiple meta_value from wp_postmeta
  82. Pull post meta with post_query?
  83. get_posts – get all posts by array of author
  84. Create a sitemap without a plugin – get parent pages only?
  85. Creating a custom search for a specific post type
  86. Group WP_Query by meta_key date
  87. get_posts – find out if querystring was crap and fallback is used
  88. WP_query posts closest to todays date
  89. Get posts for which a custom field is not present, with get_posts
  90. Creating query to show which editor (classic or block) was last used to edit a post/page
  91. get_posts() not working with multiple statuses
  92. exclude posts with a specific custom field and value
  93. Inserting serialized value into wp_postmeta using update_post_meta
  94. Return only post(s) which have post_excerpt
  95. How to make Meta Query case sensitive?
  96. Performance when getting post meta for post retrieved by meta value
  97. Return Taxonomy/Term Information with Posts (WP_Query/get_posts)
  98. Get attachment by meta_key value
  99. Display custom field meta outside loop, site wide
  100. Help with WP_Query – Too many mySQL queries
Categories wp-query Tags get-posts, post-meta, wp-query
how to customize rss feed tags using hooks?
Using color picker in plugin, does input attribute order matter?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress