Managing WordPress AJAX URLs

Public Original Author Jessica December 22, 2023

It’s quite common for admin-ajax.php URLs from WordPress sites to appear in Google Webmaster Tools (now known as Google Search Console). These URLs are part of WordPress’s AJAX infrastructure, which is used by WordPress themes and plugins to handle asynchronous requests on the admin side.

However, these URLs shouldn’t typically be indexed by Google, as they’re not part of the site’s content that visitors should be accessing directly. Here are some steps you can take to address this issue:

1. Check for Misconfiguration: Ensure that your WordPress installation, themes, and plugins are properly configured. Sometimes, poorly designed themes or plugins can inadvertently cause AJAX URLs to be exposed to search engines.

2. Update Robots.txt: You can explicitly disallow these URLs in your robots.txt file. Adding a rule like `Disallow: /wp-admin/admin-ajax.php` will tell search bots not to crawl these URLs.

3. Use Meta Tags: Ensure that pages making heavy use of AJAX calls have appropriate meta tags set to prevent indexing. For example, adding in the HTML head.

4. Check Internal Links: Sometimes, these URLs are inadvertently linked from within your site content. Use a tool to crawl your site and identify any such internal links.

5. Review Google Search Console: Use the Google Search Console to remove any of these URLs that have already been indexed. You can use the URL Removal tool to temporarily block URLs from appearing in search results.

6. Monitor AJAX Calls: If you have custom AJAX functionality on your site, review the code to ensure it’s not generating URLs that could be picked up by search engines.

7. Update and Maintain: Regularly update WordPress, themes, and plugins to their latest versions. Sometimes, updates include fixes for issues like these.

8. Consult Documentation: Check the documentation for any plugins or themes you’re using to see if they mention anything specific about handling AJAX calls and search engines.

Remember, while it’s important to address these URLs appearing in search results, they’re usually not harmful to your site’s overall SEO unless they’re causing duplicate content issues or are particularly heavy on server resources.