Improve performance of WP_Query

Updated at: 16 April 2021

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 );
Autor: Michał KuczekMichał Kuczek

Founder of Biiird Studio, UX designer, business philosopher, psychologist, and conflict mediator.