InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

robots.txt

  • Online robots.txt check
  • wildcard
  • disallow all
  • resubmit robots.txt to Google
  • Googlebot and js, css crawl
  • robot noindex, follow for wordpress
  • Allow Google adsense bot
  • parse robots.txt using python
 
  • Home
  • > Tutorials
  • > Web Development
  • > SEO
  • > robots.txt

How to use wildcard in robots.txt

By admin on Jan 26, 2016

By default Disallow entry in robots.txt is based on url prefix. To block every url beginning with /foo/ the following robots.txt can be used.

User-agent: *
Disallow: /foo/

One can also use wildcard in robots.txt for more flixible rules. Here are some robots.txt examples using wild card in url.

Using wildcard in robots.txt

To support more complex Disallow rules, we can use wildcard in between. So to disallow every url which has /foo/ in url anywhere, the following robots.txt can be used:

User-agent: *
Disallow: /*/foo/

Block 2nd and higher tag pages in wordpress

To block 2nd and higher tag pages in wordpress one can use the following robots.txt

User-agent: *
Disallow: /tag/*/page/

Block comment feed urls in wordpress

User-agent: *
Disallow: /*/feed/

Note this will not block /feed/

Suggested posts:

  1. WordPress mysql query to get all posts with a missing custom field
  2. Github tutorial for beginners
  3. Screenflow 4 export options
  4. How to allow mysql access on AWS/EC2 from a specific IP
  5. Find image unique colors and bit depth using imagemagick identify
  6. Chrome extension tutorial – hello world
  7. How to use your own domain name for feedburner feed urls
  8. How to ping feedburner to force update rss cache
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged robots.txt, Tutorials, Web Development, Webmaster
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress