Speed optimization of $wpdb->get_results
Your query is incorrect in the first place because you’re not doing the join correctly. What you’re actually selecting with that query is just all the postmeta’s autor fields, without regards to whether the post is published or not. Here’s the corrected query. SELECT meta_value AS autor FROM wp_posts JOIN wp_postmeta ON (wp_postmeta.post_id = wp_posts.ID) … Read more