0

Suddenly one of my test sites became absolutely unresponsive after testing with wp_insert_post( $my_post )

I Installed the black box plugin and checked what queries are slowing it down

I found one that takes 10 seconds to load. I deactivated all plugins that were activated recently but it's still slowing everything down. Also noticed that PHP crashed a couple times due to this. Any ideas what could be causing such a slowdown?

I REMOVED PARTS due to the length (end: WHERE option_name = 'rewrite_rules';)

UPDATE `wp_options` SET `option_value` =
'a:77:{s:47:\"category/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:42:\"category/(.+?)/(feed|rdf|rss|rss2|atom)/?$\";s:52:\"index.php?category_name=$matches[1]&feed=$matches[2]\";s:35:\"category/(.+?)/page/?([0-9]{1,})/?$\";s:53:\"index.php?category_name=$matches[1]&paged=$matches[2]\";s:17:\"category/(.+?)/?$\";s:35:\"index.php?category_name=$matches[1]\";s:44:\"tag/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$\";s:42:\"index.php?name=$matches[1]&feed=$matches[2]\";s:35:\"([^/]+)/(feed|rdf|rss|rss2|atom)/?$\";s:43:\"index.php?name=$matches[1]&feed=$matches[2]\";s:28:\"([^/]+)/page/?([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&paged=$matches[2]\";s:35:\"([^/]+)/comment-page-([0-9]{1,})/?$\";s:44:\"index.php?name=$matches[1]&cpage=$matches[2]\";s:20:\"([^/]+)(/[0-9]+)?/?$\";s:43:\"index.php?name=$matches[1]&page=$matches[2]\";}'
WHERE `option_name` = 'rewrite_rules';
1

1 Answer 1

1

The solution was to change the permalink structure from

/%postname%/%post_id%

to:

/%post_id%/%postname%/

This magically fixed it - possibly Wordpress queries are not so efficient the other way around or I ran into a bug with a plugin. Anyway, it's blazing fast again, both backend and frontend

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.