S
S
Skrolea2016-10-26 11:10:46
linux
Skrolea, 2016-10-26 11:10:46

Where is robots.txt in Wordpress?

Good afternoon. Given a site on WordPress, I type the domain site.ru/robots.txt - in it

User-agent: *
Disallow: /

I climb via ftp, robots.txt is at the root
User-agent: *
Disallow: /cgi-bin        
           
Disallow: /search           
Disallow: /author/          
Disallow: *?attachment_id=  
Disallow: */trackback
Disallow: */feed            
Disallow: */embed      
#Disallow: /wp/             

Host:  www.site.ru

How to remove Disallow from all search engines?
.htaccess
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
    <IfModule mod_headers.c>
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
        AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/bmp application/java application/msword application/vnd.ms-fontobject application/x-msdownload image/x-icon application/json application/vnd.ms-access application/vnd.ms-project application/x-font-otf application/vnd.ms-opentype application/vnd.oasis.opendocument.database application/vnd.oasis.opendocument.chart application/vnd.oasis.opendocument.formula application/vnd.oasis.opendocument.graphics application/vnd.oasis.opendocument.presentation application/vnd.oasis.opendocument.spreadsheet application/vnd.oasis.opendocument.text audio/ogg application/pdf application/vnd.ms-powerpoint application/x-shockwave-flash image/tiff application/x-font-ttf application/vnd.ms-opentype audio/wav application/vnd.ms-write application/font-woff application/font-woff2 application/vnd.ms-excel
    <IfModule mod_mime.c>
        # DEFLATE by extension
        AddOutputFilter DEFLATE js css htm html xml
    </IfModule>
</IfModule>
<FilesMatch "\.(bmp|class|doc|docx|eot|exe|ico|json|mdb|mpp|otf|_otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|pot|pps|ppt|pptx|svg|svgz|swf|tif|tiff|ttf|ttc|_ttf|wav|wri|woff|woff2|xla|xls|xlsx|xlt|xlw|BMP|CLASS|DOC|DOCX|EOT|EXE|ICO|JSON|MDB|MPP|OTF|_OTF|ODB|ODC|ODF|ODG|ODP|ODS|ODT|OGG|PDF|POT|PPS|PPT|PPTX|SVG|SVGZ|SWF|TIF|TIFF|TTF|TTC|_TTF|WAV|WRI|WOFF|WOFF2|XLA|XLS|XLSX|XLT|XLW)$">
    <IfModule mod_headers.c>
         Header unset Last-Modified
    </IfModule>
</FilesMatch>
# END W3TC Browser Cache
# BEGIN W3TC CDN
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css)$">
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# END W3TC CDN
# BEGIN W3TC Page Cache core
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteRule .* - [E=W3TC_ENC:_gzip]
    RewriteCond %{HTTP_COOKIE} w3tc_preview [NC]
    RewriteRule .* - [E=W3TC_PREVIEW:_preview]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} =""
    RewriteCond %{HTTP_COOKIE} !(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle) [NC]
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" -f
    RewriteRule .* "/wp-content/cache/page_enhanced/%{HTTP_HOST}/%{REQUEST_URI}/_index%{ENV:W3TC_PREVIEW}.html%{ENV:W3TC_ENC}" [L]
</IfModule>
# END W3TC Page Cache core
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Maxim, 2016-10-26
@Skrolea

It is possible that SEO plugins are installed that replace robots with their own. Then you can try to pick it up from the plugin settings. Or yes, there are problems with setting up the server and robots are issued from another place / project.

R
Rou1997, 2016-10-26
@Rou1997

Wordpress has nothing to do with it, it's something with the server configuration (Apache/nginx).

N
Nikolai Dmitriev, 2019-06-27
@N1k0lay

Many are looking for robots for a long time, especially when it is not physically there (the file itself). Here it is written how to find robots txt - https://site-for-yourself.rf/wordpress/robots-txt-dlja...

D
dampiru, 2021-05-05
@dampiru

When you find where to edit the robots.txt file in your WordPress, I invite you here: https://dampi.ru/pravilnyiy-robots-txt-dlya-sayta-... I just described in detail everything that needs to be done. For those who like to shove anything into robots: if you open uploads for all bots, then uploaded PDF and other text files appear in the index. And in Yandex webmaster, in the "Excluded pages" report, error messages appear when indexing pictures, saying that the content is not supported. Before writing and giving advice, did you try to analyze the messages of GSC and YaWebmaster?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question