R
R
Roman2015-04-15 22:46:19
Search Engine Optimization
Roman, 2015-04-15 22:46:19

How to remove links to .php and .js files from Google results?

Site on Wordpress. .php and .js files got into Google's additional issue
Until January of this year, robots.txt and the meta tag were configured haphazardly. In January, I set up the site according to the article Alaich 'a:
It is written in robots.txt:

User-agent: *
Allow: /wp-content/uploads
Disallow: /wp-
Host: site.com
Sitemap: http://site.com.xml

Functions.php says:
/* Robots */
function meta_robots () {
if (get_query_var('cpage') or is_archive() or is_category() or is_feed () or is_author() or is_date() or is_day() or is_month() or is_year() or is_tag() or is_tax() or is_attachment() or is_paged() or is_search()) 
{
echo "".'<meta name="robots" content="noindex,nofollow" />'."\n";}
}
add_action('wp_head', 'meta_robots'); 
/*--------------------------------------*/

Please give me advice, in particular, tell me how to get rid of .php and .js files and how to speed up the removal of unnecessary pages (archives, categories, ...) from additional output.
Thank you for your reply.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Yanovsky, 2015-04-15
@llgruff

Well, except to password-protect directories, but why?
https://support.google.com/webmasters/answer/93708
Perhaps the robot has not had time to scan everything yet.
https://support.google.com/webmasters/answer/93710
Alternatively, in the webmaster panel, try to view as Googlebot the pages that need to be kicked out of the index. Then the robot will see the meta tag and, perhaps, follow the recommendations faster.
https://support.google.com/webmasters/answer/6066467

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question