大网数据广告活动
网站运营与故障问答

Prevent Google from seeing "svg" as a content keyword without using .htaccess

· 52CE 我爱测

Is there a simple way to do this without using "X-Robots-Tag: noarchive" and robots.txt ? Because in some shared hosting packages it is not possible to modify this kind of values. I have came across with an alternative solution: …

问题原文

原帖链接 · mirza · CC BY-SA 3.0

Is there a simple way to do this without using "X-Robots-Tag: noarchive" and robots.txt ? Because in some shared hosting packages it is not possible to modify this kind of values.

I have came across with an alternative solution:

<meta name="robots" content="noindex">

This one also seems like not valid for svg files.

Problem:

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 3.0

Your problem is not that SVG images are getting indexed. The items in your screenshot are image directories. If you visit those URLs you will likely see a list of files that are in the directories. Since they are image directories, the generated index page uses the word "svg".

This is a feature of web servers called "directory index". If you have .htaccess you can turn that off:

Options -Indexes 

Otherwise, you can upload an index.html file into each of those directories. The index.html file will take the place of the automatically generated directory listing. You could make the index.html file meta refresh to the home page, and put a noindex directive in it for good measure:

<!DOCTYPE html>
<html><head>
    <meta http-equiv="refresh" content="0; url=/">
    <meta name="robots" content="noindex">
</head></html>

I also want to point out that svg as a content keyword is not a problem that has to be fixed. Google shows the content keywords report so that you can check for spam. If you saw "viagra" or "escorts" on that list you would know your site has been hacked with unsavory content injected onto it.

As long as the keywords in the content keyword report are not spammy, you don't have to take any action because of it.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。