This issue has existed in my WP instance for a while and I've been banging my head against the wall trying to fix it.

Here is the issue:

Adding a new category is successful, but the page doesn't update automatically due to an AJAX bug. Refreshing the page shows the new category as expected.

Here is what I have observed:

  • AJAX on other parts of the site including admin views works as expected.
  • Switching my theme fixes the issue.
  • My child theme doesn't have any changes to the edit-tags.php page. If it does I'm unaware of these changes and do not have a full understanding of the hooks.
  • This AJAX bug returns 200 OK, so the response format or handling is the issue.
  • The wp_ajax response isn't formatted in the Preview tab of Chrome but the response looks fine when parsing it (see image - normal on left and bug on right). This is the only notable thing I have uncovered so far.

Screenshot of Chrome DevTools - admin-ajax working normally on the left and a bug on the right

This bug throws an error in the WP SEO Plugin because the data is not what is expected:

  TypeError: Cannot read property 'indexOf' of undefined
  at HTMLDocument.<anonymous> (/wp-content/plugins/wordpress-seo/js/dist/quick-edit-handler-1470.js:1:975)

This is the code.. the data isn't what is expected.


My gut is telling me a WP upgrade caused this, but it also could have been a side effect of a change I made. Maybe removing a certain script from the admin screen or changing the JS load order?? I really haven't touched this view which is why this is puzzling.

I'm at a loss and any help is greatly appreciated. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.