The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Content & Blogging
    4. Please help me stop google indexing https pages on my wordpress site

    Please help me stop google indexing https pages on my wordpress site

    Content & Blogging
    8 3 5.6k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rookie123
      rookie123 last edited by

      I added SSL to my wordpress blog because that was the only way to get a dedicated IP address for my site at my host. Now I am noticing Google has started indexing posts both as http and https. Can some one please help how to force google not to index https as I am sure its like having duplicate content. All help is appreciated. So far I have added this to top of htaccess file: RewriteEngine on

      Options +FollowSymlinks

      RewriteCond %{SERVER_PORT} ^443$

      RewriteRule ^robots.txt$ robots_ssl.txt And added robots_ssl.txt with following: User-agent: Googlebot Disallow: /  User-agent: * Disallow: /

      But https pages are still being indexed. Please help.

      1 Reply Last reply Reply Quote 0
      • StalkerB
        StalkerB last edited by

        The problem here is you've not told the robots to noindex the https version, you've simply said they're not allowed to crawl it, but if they see a link go to there they know it exists in some capacity. What you need is the robots noindex tag on all these pages.

        If you have some way of differentiating the https pages in your template then you just need to add

        to the header.

        If you can't then you can try to do it by putting this bit of php in your header

        if ($_server['https] == "on") {
        echo ";
        }

        ?>

        I would guess there's some dangers in that doing bad stuff to your site, so make sure and test it. If it appears on all your pages take it off immediately!

        rookie123 1 Reply Last reply Reply Quote 0
        • rookie123
          rookie123 @StalkerB last edited by

          Its a wordpress site and actually I do not even have a single page that needs https.

          I am also thinking of just getting rid of ssl from my site. I added it to have a unique IP for my site cause I had heard it helps with SEO but I think the issues outweigh the benefits.
          What do u think is better, do these code changes or just get rid of SSL?

          StalkerB rookie123 4 Replies Last reply Reply Quote 0
          • StalkerB
            StalkerB @rookie123 last edited by

            Can you just redirect the https to the http version?

            Options +FollowSymlinks
            RewriteEngine on
            RewriteBase /

            RewriteCond %{SERVER_PORT} ^443$ [OR]

            RewriteCond %{HTTPS} =on
            RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

            1 Reply Last reply Reply Quote 0
            • rookie123
              rookie123 @rookie123 last edited by

              Barry,

              I will try that also. Also wanted to ask you what you think about adding following to the template.

              if ($_SERVER['HTTPS'] = "on") {
                  echo 'content="noindex, nofollow">';
              }
              
              1 Reply Last reply Reply Quote 0
              • StalkerB
                StalkerB @rookie123 last edited by

                Did you just copy code from Digital Point or have SEOmoz started putting ads in? 😄

                The nofollow should in theory stop bots wandering around the https version once they're on there, so can't hurt.

                I think you're best redirecting the https version though if you don't need it at all.

                1 Reply Last reply Reply Quote 1
                • rookie123
                  rookie123 @rookie123 last edited by

                  Hehe. Some one on DP suggested that.

                  So are you saying just add this to htaccess

                  Options +FollowSymlinks

                  RewriteEngine on

                  RewriteBase /

                  RewriteCond %{SERVER_PORT} ^443$ [OR]

                  RewriteCond %{HTTPS} =on

                  RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=301,L]

                  I am just trying to understand what it actually do? Also I am guessing i will have to deindex already indexed https pages from webmaster tools.

                  1 Reply Last reply Reply Quote 0
                  • CPU
                    CPU last edited by

                    Hi Rookie123

                    Having unique IP's may be of use from an SEO perspective if you have multiple sites that you are interlinking with the hope of boosting SEO. However there is no guarantee that Google will not be able to work out that the sites are still in fact related.

                    If this is a single stand alone site then I would not worry about having a unique IP as I am not aware of any tangible benefit and would be more focused on resolving the duplicate content issue.

                    Hope this helps.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    • If my blog is on Wordpress, and I've installed the AMP plug-in, what do I need to do to get Google to start indexing all my posts as AMP pages?
                      SproutDigital
                      SproutDigital
                      0
                      4
                      43

                    • Can Google+ help you to rank?
                      Hurf
                      Hurf
                      1
                      4
                      63

                    • What are the effects of posting on a blog site using copied content from your site if you source the site on the blog site?
                      CommT
                      CommT
                      0
                      3
                      102

                    • How do I properly sitemap a site with static pages + Wordpress in it's own directory?
                      Qcmny
                      Qcmny
                      0
                      3
                      356

                    • Wordpress Website Was not indexing from last 3 days in google.com
                      amar9290
                      amar9290
                      0
                      4
                      141

                    • Site Content Review Please!
                      orion68
                      orion68
                      0
                      12
                      302

                    • Wordpress Ping List, does pinging Google Help? Could it hurt?
                      DanDeceuster
                      DanDeceuster
                      0
                      4
                      1.3k

                    • Our blog is indexed by "google web" but does not show up in "google blogs". Why not and how can I fix this?
                      Aviawest
                      Aviawest
                      0
                      5
                      720

                    Get started with Moz Pro!

                    Unlock the power of advanced SEO tools and data-driven insights.

                    Start my free trial
                    Products
                    • Moz Pro
                    • Moz Local
                    • Moz API
                    • Moz Data
                    • STAT
                    • Product Updates
                    Moz Solutions
                    • SMB Solutions
                    • Agency Solutions
                    • Enterprise Solutions
                    • Digital Marketers
                    Free SEO Tools
                    • Domain Authority Checker
                    • Link Explorer
                    • Keyword Explorer
                    • Competitive Research
                    • Brand Authority Checker
                    • Local Citation Checker
                    • MozBar Extension
                    • MozCast
                    Resources
                    • Blog
                    • SEO Learning Center
                    • Help Hub
                    • Beginner's Guide to SEO
                    • How-to Guides
                    • Moz Academy
                    • API Docs
                    About Moz
                    • About
                    • Team
                    • Careers
                    • Contact
                    Why Moz
                    • Case Studies
                    • Testimonials
                    Get Involved
                    • Become an Affiliate
                    • MozCon
                    • Webinars
                    • Practical Marketer Series
                    • MozPod
                    Connect with us

                    Contact the Help team

                    Join our newsletter
                    Moz logo
                    © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                    • Accessibility
                    • Terms of Use
                    • Privacy