Correct robots.txt for WordPress
-
Hi. So I recently launched a website on WordPress (1 main page and 5 internal pages). The main page got indexed right off the bat, while other pages seem to be blocked by robots.txt. Would you please look at my robots file and tell me what‘s wrong?
I wanted to block the contact page, plugin elements, users’ comments (I got a discussion space on every page of my website) and website search section (to prevent duplicate pages from appearing in google search results). Looks like one of the lines is blocking every page after ”/“ from indexing, even though everything seems right.
Thank you so much.
-
Me too, can you upload or screenshot the actual file that you are using
-
I have edited it down to
User-Agent: * Allow: /wp-content/uploads/ Disallow: /wp-content/plugins/ Disallow: /wp-admin/ Disallow: /contact/ Disallow: /refer/ It didn’t help. I get a “Blocked by robots.txt” message after submitting the URL for indexing in google webmaster tools. I’m really puzzled.
-
Hi, in addition to the answer that effectdigital gave; another option,optimised for WordPress:
User-Agent: *
Allow: /wp-content/uploads/
Disallow: /wp-content/plugins/
Disallow: /wp-admin/
Disallow: /readme.html
Disallow: /refer/Sitemap: http://www.example.com/post-sitemap.xml
Sitemap: http://www.example.com/page-sitemap.xml -
Just seems overly complex and like there's way more in there than there needs to be
I'd go with something that 'just' does what you have stated that you want to achieve, and nothing else
User-Agent: *
Disallow: /wp-content/plugins/
Disallow: /comments
Disallow: /*?s=
Disallow: /*&s=
Disallow: /search
See if that helps
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Is it OK to put a Blog Post and a Page within the same folder on a Wordpress hosted website?
Our education company website (hosted on wordpress) has evolved into having content on key topics distributed across both blog posts and pages. For example, "top-pharmaceutical-companies" lends itself to being published as a page. However other content "top-pharmaceutical-companies-usa-2016" lends itself to being published as a blog post as it's more temporal in nature. Now we'd like to establish topical domain relevance for the root keyword "pharmaceutical companies" and build a folder www./ourcompany/pharmaceutical-companies/ But when we look through our blog content, we notice we have "Blog Posts" that would be an excellent fit for certain folders within our "Page" url structure. So would it be OK to amend these blogs post urls addresses to place them within the folder structure of the pages.
On-Page Optimization | | GetReskilled0 -
What's the best way to host Videos on my Wordpress site? (SEO-wise)
I have a hard time choosing whether to stream my videos from certain platforms like vimeo, youtube, etc. or embedding the videos into my site, and I'm not quite sure which one Google would like to see more of? And which style will save my page speed from plummeting too much. Any ideas? Thanks guys
On-Page Optimization | | Benavest0 -
No-index or 301 - custom wordpress archives
Hi, We are using custom wordpresss posts to showcase different services we provide, these are then grouped within custom archives. These custom archive pages are our main keyword landing pages and traffic generators (although ranking is fairly average). It's come to my attention that these custom posts have also been listed in the wordpress standard categories, with an identical title, excerpts and near identical urls as the custom archives. This appears to have been the case for quite a while. We are concerned that this is may causing duplicate content issues and unsure how to proceed. We have been advised to simply no-index the redundant 'standard' categories but as they have been indexed for some time we are cautious of causing any upset with search engines (although the categories are indexed they are not ranking for any major keywords) Are we best 301ing the redundant category to the custom archives or using a canonical tags or simply no-indexing the categories like other archive pages? Any advice is aprreciated Many thanks BC
On-Page Optimization | | benct0 -
Meta Robots index & noindex Both Implemented on Website
I don't want few of the pages of website to get indexed by Google, thus I have implemented meta robots noindex code on those specific pages. Due to some complications I am not able to remove meta robots index from header of every page Now, on specific pages I have both codes 'index & noindex' implemented. Question is: Will Google crawl/index pages which have noindex code along with index code? Thanks!
On-Page Optimization | | Exa0 -
Webs Pages not correct
First of all I am a beginner but that will show with this question. I have moved my website from Wix to Web.com. I had the dns I think that is correct re-direct my site to web.com. Since then some of the pages from wix still show up even though they are no long apart of my site. Secondly when I go to google and type in cestoday.com some of the pages gives me a 401 or 404 error code, and others do not link to the proper page on my website. They go to my web-site but not the correct page. What do I do. Thank you Dave
On-Page Optimization | | redsman944
cesyes@hotmail.com In reference to my last question about moz not being able to see my pages and giving me an "F" I thought you might find it interesting to know that that same page once moved got an A amazing.0 -
Wordpress & trailing slash on domain name
Hi recently changed my site so it is based on Wordpress, got my preferred domain set in Google webmaster as www.domian.co.uk but since moving to wordpress my domain is now having a slash put on the end of it like www.domain.co.uk/ Most of the links going to my homepage do not have the slash on the end so am I right in thinking I should get rid of the slash from my site so I have one consistent url? If so any ideas how to banish the slash? Cannot seem to do it through the Wordpress general settings (despite preferred domain being set as www.domain.co.uk !) Thanks T
On-Page Optimization | | Jon-C0 -
AD on wordpress
I notice advertisement hyperlinks on my site such as hyperlinks on my test gift, fill out etc. I never put hose links but somehow it shows up on firefox. Does anyone experience this? It's showing up this url http://www.soobumimphotography.com/portfolio/wedding/
On-Page Optimization | | BistosAmerica0 -
Does Google respect User-agent rules in robots.txt?
We want to use an inline linking tool (LinkSmart) to cross link between a few key content types on our online news site. LinkSmart uses a bot to establish the linking. The issue: There are millions of pages on our site that we don't want LinkSmart to spider and process for cross linking. LinkSmart suggested setting a noindex tag on the pages we don't want them to process, and that we target the rule to their specific user agent. I have concerns. We don't want to inadvertently block search engine access to those millions of pages. I've seen googlebot ignore nofollow rules set at the page level. Does it ever arbitrarily obey rules that it's been directed to ignore? Can you quantify the level of risk in setting user-agent-specific nofollow tags on pages we want search engines to crawl, but that we want LinkSmart to ignore?
On-Page Optimization | | lzhao0