• I get messages from Google that there is a problem with my sitemap. (not produced by a Plugin)

    Google has a problem with this folder .com/wp-json/oembed/ How can I hide it, but still let it work?

    Regards
    Drachsi

    • This topic was modified 3 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • You can exclude a folder from being indexed by locating the robots.txt in the root of your wordpress installation. Then add this line (change to the folder of your choice):

    Disallow: /wp-content/Your-example-folder

    You can also target the folder directly by creating a .htaccess file in said folder with the following:

    Header set X-Robots-Tag "noindex, nofollow"

    You should make sure the Apache server has ‘mod_headers’ enabled.

    Thread Starter Drachsi

    (@drachsi)

    Hi,

    Thank you very much for a quick and clear reply.

    Unfortunately the Disallow did not work. Stopped the site totally from working, and this error message, “Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.”

    Regards
    Drachsi

    Phill

    (@phillsav)

    I’m not sure why the adding a disallow rule to your robots.txt would cause a 500 error, nether the less noindexing in .htaccess should work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I set a folder to no-index?’ is closed to new replies.