Improve performance of WP_Query

Contents

Using these three arguments as an addition to your’s can speed up the query process. Check the comments to be sure you can use them.

$args = [
	// Your query arguments here
	'no_found_rows' => true, // counts posts, remove if you need pagination
	'update_post_term_cache' => false, // queries terms, remove if you need categories or tags
	'update_post_meta_cache' => false, // queries post meta, remove if you need post meta
];

$loop = new WP_Query( $args );
Mike Kuczek

Mike Kuczek

WordPress developer, designer, psychology student and bluberry farmer. CEO of Biiird Studio.
❤ SHARE, THANK YOU ❤
Share on facebook
Share on twitter
Share on linkedin
Share on email

Improve performance of WP_Query

Using these three arguments as an addition to your’s can speed up the query process. Check the comments to be sure you can use them.

[wbcr_php_snippet id="820"]

Leave a Comment

Your email address will not be published. Required fields are marked *

Zasób 1

Switch to Polish: 

Ta strona korzysta z plików cookie, korzystając z niej zgadzasz się na ich wykorzystanie. Więcej informacji.