开发者 | RavanH |
---|---|
更新时间 | 2024年10月4日 22:58 |
捐献地址: | 去捐款 |
PHP版本: | 5.6 及以上 |
WordPress版本: | 6.5.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
define('XMLSF_MULTISITE_UNINSTALL', true);
is explicitly set in wp-config.php.On Settings > Reading you can enable the XML Sitemap Index and (if needed) the Google News Sitemap. There is also an Additional robots.txt rules field. Once a sitemap is enabled, its options can be found on Settings > XML Sitemap or on Settings > Google News. Ping settings can be found on Settings > Writing.
Go to Suggest News Content for Google News and submit your website info as detailed as possible there. Give them the URL(s) of your fresh new Google News Sitemap in the text field 'Other' at the bottom. You will also want to add the sitemap to your Google Search Console account to check its validity and performance. Create an account if you don't have one yet.
You can find default settings for Priority on Settings > XML Sitemap. A fixed priority can be set on a post by post basis too. 由于 Google 已不再将其纳入考虑,自 4.9 版本起,弃用 Changefreq。
不需要。在正常情况下,你的网站将在你发觉之前便被主流搜索引擎索引完毕。搜索引擎将会查看 Robots.txt 文件并(在本插件激活的情况下)找到指向你的博客的 XML 站点地图的指针。搜索引擎将会定期返回以确认你的站点是否更新了任何内容。 NOTE: If you have a server without rewrite rules, use your blog without fancy URLs (meaning, you have WordPress Permalinks set to the old default value) or have it installed in a subdirectory, then read Do I need to change my robots.txt for more instructions.
Google & Bing are no longer accepting sitemap pings.
在一般情况下,如果你的站点根目录下没有一份静态的 robots.txt 文件,那么站点地图的地址将自动添加进由 WordPress 动态生成的 robots.txt 文件中。
If you use a static robots.txt file in your website root, you will need to open it in a text editor. If there is already a line with Sitemap: http://yourblogurl.tld/sitemap.xml
you can just leave it like it is. But if there is no sitemap referrence there, add it (adapted to your site url) to make search engines find your XML Sitemap.
Or if you have WP installed in a subdirectory, on a server without rewrite_rules or if you do not use fancy URLs in your Permalink structure settings. In these cases, WordPress will need a little help in getting ready for XML Sitemap indexing. Read on in the WordPress section for more.
这取决于你的 index.php 与 .htaccess 文件被安装到何处。如果它们都被放置在根目录下,同时其它余下的 WP 文件都被放置在子目录下,那么你的站点便可以通过你的域名直接访问,不需要再进行其它操作。插件应当开箱即用。
But if the index.php is together with your wp-config.php and all other WP files in a subdir, meaning your blog is only accessible via that subdir, you need to manage your own robots.txt file in your domain root. It has to be in the root (!) and needs a line starting with Sitemap:
followed by the full URL to the sitemap feed provided by XML Sitemap Feed plugin. Like:
Sitemap: http://yourblogurl.tld/subdir/sitemap.xml
如果你业已拥有一个写有其它站点地图地址的 Robots.txt 文件,只需在该地址上方或下方添加一行全线。
并非如此。虽然我仍会建议你采用任何一种更好的永久链接结构以促进更便利的索引。或许你不能够(或是不愿意)去修改它们,即使在此情况下,你依旧可以使用本插件: 检查链接 yourblog.url/?feed=sitemap 是否提供了一个订阅源。现在手动向你的网站根目录下保存的你自己的 Robots.txt 文件中上传如下字段: ` Sitemap: http://yourblog.url/?feed=sitemap User-agent: * Allow: / ` You can also choose to notify major search engines of your new XML sitemap manually. Start with getting a Google Search Console account and submit your sitemap for the first time from there to enable tracking of sitemap downloads by Google! or head over to XML-Sitemaps.com and enter your sites sitemap URL.
No. If you have fancy URL's turned ON in WordPress (Permalinks), the sitemap url is yourblogurl.tld/sitemap.xml
but if you have the Permalink Default option set the feed is only available via yourblog.url/?feed=sitemap
.
实际上没有任何实在文件会被创建。站点地图是如同订阅源(feed)一般动态生成的。
你可能在使用本插件之前使用了其他的 XML 站点地图插件,你正在查看 sitemap.xml 文件就是由其所创建的。删除该文件并让本插件动态生成站点地图,一如生成订阅源那般。本插件不会创建任何实际的文件。 如果实际情况并非如此,你可能正在使用缓存插件,或你的浏览器没有获取最新的订阅源输出。请进行检查。
一些缓存插件会提供是否对订阅源与站点地图进行缓存的选项。请确保它们处于启用状态。 Frederick Townes, developer of W3 Total Cache, says: "There's a checkbox option on the page cache settings tab to cache feeds. They will expire according to the expires field value on the browser cache setting for HTML." 谷歌新闻地图是以不被缓存为出发点而设计的。
The absolute first thing you need to check is your blogs privacy settings. Go to Settings > Privacy and make sure you are allowing search engines to index your site. If they are blocked, your sitemap will not be available.
Then, you might want to make sure that there is at least ONE post published. WordPress is known to send 404 status headers with feed requests when there are NO posts. Even though the plugin tries to prevent that, in some cases the wrong status header will get sent anyway and Google Search Console will report a vague message like:
We encountered an error while trying to access your Sitemap.
Please ensure your Sitemap follows our guidelines and can be
accessed at the location you provided and then resubmit.
如果这些措施都不能解决本问题,请确认下面这些错误及其各自的解决方案是否存在或有效:
404 page instead of my sitemap.xml
Try to refresh the Permalink structure in WordPress. Go to Settings > Permalinks and re-save them. Then reload the XML Sitemap in your browser with a clean browser cache. ( Try Ctrl+R to bypass the browser cache -- this works on most but not all browsers. )
404 page instead of both sitemap.xml and robots.txt
有些插件,诸如 Event Calendar(至少从 V3.2 Btea2 起)已知存在重写规则的混乱,会导致 WordPress 内部订阅源与 Robots.txt 文件的生成出现问题,因此它们与 XML 站点地图订阅源插件是存在冲突的。你可以尝试停用所有插件来查看你是否能获得一个包含基础信息的 Robots.txt 文件形如:
User-agent: * Disallow:
你需要一次一个地重新激活你的以确认是哪一个插件造成了该问题。然后将其报告给该插件的开发人员。
404 page instead of robots.txt while sitemap.xml works fine
There is a known issue with WordPress (at least up to 2.8) not generating a robots.txt when there are no posts with published status. If you use WordPress as a CMS with only pages, this will affect you.
To get around this, you might either at least write one post and give it Private status or alternatively create your own robots.txt file containing:
`
Sitemap: http://yourblog.url/sitemap.xml
User-agent: *
Allow: /
`
并将其上传至你的网站根目录。
Error loading stylesheet: An unknown error has occurred
在某些安装与配置的情况下(通常是使用 WordPress MU Domain Mapping 插件)会造成此错误的发生。虽然问题业已定位,但原因却尚无法弄清……除非我能找出为什么会发生这种事。不过请尽管放心,目前已知这个错误只会在通过一般浏览器阅读站点地图时产生影响,但不会影响搜索引擎对你网站的索引。站点地图依旧对所有搜索引擎可读。
XML declaration allowed only at the start of the document
当有空白行或其他输出内容生成于实际站点地图内容之前时,就会产生这一错误。这可能是由于 wp-config.php 或你使用的主题的 functions.php 开头存在空白行,或其它不该输出相关内容的插件生成并输出了内容,并插入到站点地图文件之前。你需要通过禁用所有插件并切换至默认主题、同时手动检查你的 wp-config.php 文件来测试是何种原因导致了这一问题。
有几种情况可能会导致本错误的发生。
在浏览器中打开你的站点地图并查看其源代码。这步操作通常可以通过快捷键 Ctrl+U 或在右键弹出菜单中选择“查看源代码…”来进行,你需要检查给出的源代码以判断其中是否存在错误。
A. If you see strange output in the first few lines (head tags) of the source, then there is a conflict or bug occuring on your installation. Please go to the Support forum for help.
B. If the source is empty or incomplete then you're probably experiencing an issue with your servers PHP memory limit. In those cases, you should see a messages like PHP Fatal error: Allowed memory size of xxxxxx bytes exhausted.
in your server/account error log file.
This can happen on large sites. To avoid these issues, there is an option to split posts over different sitemaps on Settings > XML Sitemap. Try different settings, each time revisiting the main sitemap index file and open different sitemaps listed there to check.
Read more on Increasing memory allocated to PHP (try a value higher than 256M) or ask your hosting provider what you can do.
完全可以。实际上,本插件就是为此而设计的。目前插件已在 WPMU 2.9.2 与 WPMS 3+ 下经过测试,所有测试环境均正常激活并激活了 Network Activate 与 Site Wide Activate 相关选项。
xmlsf_request
and xmlsf_news_request
xmlsf_news_publication_name
and xmlsf_news_title
xmlsf_url
xmlsf_news_url
and xmlsf_news_tags_inner
xmlsf_index_url_args
filterxmlsf_news_tags_after
to after closing tagrobotstxt_sitemap_url
for any translate and url changing plugins.add_feed
(on init) to the do_feed_$feed
hookis_404()
condition TRUE and Response Header 404 on sites without postsis_feed()
condition FALSE after custom query_postsget_post_modified_time
instead of get_post_time