Performance
WordPress
Knowledge
When migrating content, suspend cache invalidation and flush the cache afterwards.
With that in mind, the following optimisation reduces the number of database queries to 1:
- $post_data = [
- 'ID' => $post_id,
- 'post_content' => $content,
- ];
-
- $up...