• First, its a small simple site with 15 pages that are all submitting and indexing correctly.

    The issue is that Search Console is also trying to index .php and other files inside wp-includes and wp-content and that is causing a Server Error 5xx. I tried adding a .htaccess file in the wp-includes folder with:

    <FilesMatch "\.(php|css|js)$">
    Header set X-Robots-Tag "noindex"
    </FilesMatch>
    Header set X-Robots-Tag "noindex"

    That didn’t work.

    How do I stop Search Console from trying to index these files?

    Thanks

    Details

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    Try this:

    # Disable PHP Execution
    <Files *.php>
    deny from all
    </Files>
    Thread Starter ??????????????

    (@periago)

    @t-p Thanks, so that code in .htaccess will stop google indexing *.php files with no effect on the normal operation of the site?

    Also where does it go: wp-admin, wp-content, wp-include or all three?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Another Server Error 5xx on Search Console’ is closed to new replies.