Robots.txt是给机器人(这里指搜索引擎)看的,WordPress的Robots.txt是比较好创建,SEO也比较容易。很多插件有生成xml网站地图的功能,如果没有用插件,可以用WordPress自动的功能找到xml。
首先在网站根目录创建 robots.txt,在里面加上以下内容。
User-Agent: * Allow: /wp-content/uploads/ Disallow: /wp-content/plugins/ Disallow: /wp-admin/ Disallow: /readme.html Disallow: /refer/ Sitemap: http://www.example.com/post-sitemap.xml Sitemap: http://www.example.com/page-sitemap.xml
注意 Sitemap:
这一行写一条你的xml文件。