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. Technical SEO Issues
    4. How to fix these unwanted URLs?

    How to fix these unwanted URLs?

    Technical SEO Issues
    9 4 194
    • 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.
    • marknorman
      marknorman last edited by

      Right now i have wordpress, one page website, but google also show wp-content. KIndly check below in google.

      site:http://baltimoreelite.com/

      How I can fix this issue?

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

        Hi Mark,

        You need to tell crawlers to not to index those content by modifying the robots.txt file. Below is a good link with some examples and instructions

        http://stackoverflow.com/questions/17029811/how-to-set-up-robots-txt-file-for-wordpress

        1 Reply Last reply Reply Quote 0
        • Andy.Drinkwater
          Andy.Drinkwater last edited by

          Hi Mark,

          I block the same on my site (which is also a single page). Here is the content of my Robots.txt file.

          User-agent: *
          Disallow: /wp-admin/
          Disallow: /wp-includes/
          Disallow: /wp-content/
          Sitemap: http://www.inetseo.co.uk/sitemap.xml.gz
          

          -Andy

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

            You have a much bigger problem than what can be solved just with a robots.txt file, Mark.

            All of those URLs are showing up because of a misconfiguration of your theme installation (likely caused by the theme developer) is allowing full display of all of the content of each of those directories. In addition to polluting your search results, as you've noticed, it's a also a pretty major security risk. You can see this in action by going to http://baltimoreelite.com/wp-content/themes/sintia/wpv_theme/assets/css/ What should happen when you go to that URL is you see a blank page, or receive a 403-Forbidden warning. Instead, you're seeing a full listing of the directory contents - bad news.

            Since I don't know your hosting configuration, the easiest way to fix this issue is to add a line to your .htaccess file at the root of your site. This should correct for all such instances, You need to add this line:

            <code>Options -Indexes</code>
            

            If you're not familiar, the .htaccess file is a text file which you can edit with any text editor. You'll need to use an FTP program or the file manager in your hosting control panel to access it at the root of your site. (You may also need to enable "show hidden files" in your program). I always recommend backing up the existing file before editing just in case. You'll add this new line on its own line with a blank line between it and any other lines in the file. It can go near or at the top of your htaccess file.

            Now getting those URLs out of the search index is going to take a bit more work. You'll want to implement the robots.txt exclusions like Andy suggested, and then you'll need to go into Google Webmaster Tools and use the Remove URLs tool to specifically request removal of the directories you blocked with the robots.txt and that you also want removed from the search results. (The robots.txt is a critical part of this process, as Google requires it be in place in order to process the removal requests.)

            This, combined with the htaccess edit mentioned above, should keep those URLs from showing up again in teh future.

            Hope that all makes sense. If not, be sure to ask!

            Paul

            marknorman 1 Reply Last reply Reply Quote 1
            • ThompsonPaul
              ThompsonPaul @Andy.Drinkwater last edited by

              Andy and Nishada - don't forget... Adding robots.txt disallows will do nothing to get already indexed URLs out of the search index after the fact.

              Paul

              1 Reply Last reply Reply Quote 0
              • marknorman
                marknorman @ThompsonPaul last edited by

                This post is deleted!
                ThompsonPaul 1 Reply Last reply Reply Quote 0
                • ThompsonPaul
                  ThompsonPaul @marknorman last edited by

                  If I were you, Mark, I'd add it right at the top of your htaccess file. I'd also add in a descriptive comment to make the reason for the directive clear. So:

                  BEGIN Remove ability to read directory indexes

                  Options -Indexes

                  END Remove ability to read directory indexes

                  These lines would be inserted right at the top of the htaccess file. I would also warn though, that I've had situations where caching plugins have overwritten such directives when they update the htaccess themselves. If that happens, you man need to try inserting it after #END WPSuperCache and before # BEGIN WordPress.

                  Hope that works for you?

                  Paul

                  marknorman 1 Reply Last reply Reply Quote 1
                  • marknorman
                    marknorman @ThompsonPaul last edited by

                    Thank You Paul. All is well now.

                    ThompsonPaul 1 Reply Last reply Reply Quote 0
                    • ThompsonPaul
                      ThompsonPaul @marknorman last edited by

                      Great job, Mark! I can see from this end that nearly all of those unwanted URLs have already dropped out of the results. That's far quicker than even I expected! And the ones that aren't gone are leading to a 403 Forbidden page, which is great.

                      One last thing you can do if you want. Because you are on HostGator, they are displaying their custom 403 error page, which has their branding all over it (nasty, kinda ugly) You could create your own simple 403 error page, add your own basic branding to it, and for instance add a line that says something like "You don't have permission to view this page or it is blocked for security reasons. Drop by the home page [link to home page] to find what you're looking for, or to conduct a search."

                      This basic page can be used to replace the one that HostGator provides by default so any visitors that hit it by accident will still feel like they are on your site, and will have a suggestion for what to do next. Your hosting control panel will have instructions for how & where to provide your own custom error pages.

                      Hope that last little tweak's useful.

                      Paul

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      • How to fix you brand search on google? Random urls not categorys display
                        ClaytonJ
                        ClaytonJ
                        0
                        2
                        38

                      • Search Console - Should I request to index redirected URL or Mark as fixed?
                        slatronica
                        slatronica
                        0
                        4
                        915

                      • What is best practice for fixing urls that have duplicate content, non-static and other issues?
                        Stramark
                        Stramark
                        0
                        4
                        108

                      • Error in how URLs were set up, how can it be fixed?
                        DianeDP
                        DianeDP
                        0
                        3
                        83

                      • Anyone using Adobe Business Catalyst and Fixing SEO URL Blog Updates?
                        jessential
                        jessential
                        0
                        5
                        1.0k

                      • Friendly URLS (SEO urls)
                        irvingw
                        irvingw
                        0
                        5
                        217

                      • Crawl reveals hundreds of urls with multiple urls in the url string
                        irvingw
                        irvingw
                        0
                        5
                        455

                      • How do I fix these duplicate URLs?
                        rasmusbang
                        rasmusbang
                        0
                        7
                        761

                      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