How to I noindex attachments

Community Forums Forums General Discussion How to I noindex attachments

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 2 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #41518


    I need to no index attachments. I used Yoast’s plugin to do this but I see that they are still being indexed.

    I have recently moved from thesis. On Thesis I used the following code but I don’t know how to adapt it for Genesis:

    function noindex_attachments() {

        if (is_attachment())

            echo ‘<meta name=”robots” content=”noindex” />';




    Should also work in any theme because it uses the wp_head hook which is a WordPress hook and not a theme specific hook.

    Paste it at the end of your child themes functions.php file.

    Note: I wouldn’t copy and paste it from here because it hasn’t been embedded properly which can cause the Apostrophes to change and cause errors.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.