{"id":2699,"date":"2025-08-17T20:38:47","date_gmt":"2025-08-17T13:38:47","guid":{"rendered":"https:\/\/siammakemoney.com\/?p=2699"},"modified":"2025-08-19T21:26:23","modified_gmt":"2025-08-19T14:26:23","slug":"sitemap-xml","status":"publish","type":"post","link":"https:\/\/siammakemoney.com\/zh\/sitemap-xml\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528\u81ea\u5df1\u7684\u4ee3\u7801\u521b\u5efasitemap.xml\uff08\u7ad9\u70b9\u5730\u56fe\u7d22\u5f15\u6587\u4ef6\uff09"},"content":{"rendered":"<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-c8cdb34af6fd810e65dbedd894bbe172\" style=\"color:#336864;font-size:28px\">\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u800c\u57fa\u672c\u7684\u7ad9\u70b9\u5730\u56fe\u7d22\u5f15sitemap.xml<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 Python \u4ee3\u7801\u521b\u5efa sitemap.xml \u6587\u4ef6\uff0c\u5e2e\u52a9\u641c\u7d22\u5f15\u64ce\u8bc6\u522b\u6211\u4eec\u7684\u7f51\u9875\u3002\u8fd9\u91cc\u6709\u4e00\u4e2a\u4f7f\u7528 .html \u548c .php \u6587\u4ef6\u7684\u9759\u6001\u7f51\u7ad9\u793a\u4f8b\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7 Search Console \u6216 ping URL \u5c06\u5176\u53d1\u9001\u5230 Google \u548c Bing \u7684\u8bf4\u660e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ad9\u70b9\u5730\u56fe\u662f\u4e00\u4e2a\u6587\u4ef6\uff0c\u5b83\u6c47\u96c6\u4e86\u60a8\u7f51\u7ad9\u4e0a\u91cd\u8981\u9875\u9762\u7684 URL\uff0c\u5e2e\u52a9\u641c\u7d22\u5f15\u64ce\u66f4\u8f7b\u677e\u5730\u7406\u89e3\u548c\u5bfc\u822a\u60a8\u7684\u9875\u9762\uff0c\u4ece\u800c\u6709\u5229\u4e8e SEO \u5e76\u589e\u52a0\u6d41\u91cf\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u521b\u5efa\u5e76\u5411 Google \u63d0\u4ea4\u7ad9\u70b9\u5730\u56fe\u4ee5\u5b9e\u73b0\u6700\u9ad8\u6548\u7387\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n<style scoped>\n            .gc-box{margin-bottom:30px;padding:20px;border-left:5px solid transparent;line-height:24px}.gc-box .label-info{background-color:#5bc0de;display:inline-block;margin:0 5px 10px 0;padding:3px 6px;font-size:75%;font-weight:700;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em;line-height:14px}.gc-box.green_type{color:#3c763d;background-color:#dff0d8;border-color:#cae6be}.gc-box.blue_type{color:#31708f;background-color:#d9edf7;border-color:#bcdff1}.gc-box.red_type{color:#a94442;background-color:#f2dede;border-color:#e8c4c4}.gc-box.grey_type{background:#ddd;border-color:#ccc;color:#444}.gc-box.info_type{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.gc-box.info_type svg{fill:#30a030}.gc-box.download_type{color:#004085;background-color:#cce5ff;border-color:#b8daff}.gc-box.download_type svg{fill:#3a9aff}.gc-box.update_type{color:#004458;background-color:#d9edf7;border:1px solid #bce8f1}.gc-box.notice_type{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.gc-box.notice_type svg{fill:#f7a000}.gc-box.error_type{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.gc-box.error_type svg{fill:#c70000}.gc-box.border_type{border:2px solid #ddd}.gc-box.icon_type{display:flex}.gc-box.icon_type .gc-box-icon{width:28px}.gc-box.icon_type .gc-box-text{flex-grow:1;margin:0 15px}.gc-box-text > *{margin-bottom: 20px;}\n        .gc-box-text > *:last-child{margin-bottom:0}        \n        <\/style><div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-51055fbf0388df6c69b33d911bf8dd7c\" style=\"color:#1a8079;font-size:30px\">1. \u4e86\u89e3\u7ad9\u70b9\u5730\u56fe\u548c\u7ad9\u70b9\u5730\u56fe\u7d22\u5f15<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7f51\u7ad9\u5730\u56fe<\/strong>\uff1a\u5b83\u662f\u4e00\u4e2a XML \u6587\u4ef6\uff0c\u53ef\u4ee5\u544a\u8bc9 Google \u7b49\u641c\u7d22\u5f15\u64ce\u6211\u4eec\u7684\u7f51\u7ad9\u4e0a\u6709\u54ea\u4e9b\u9875\u9762\u3002<\/li>\n\n\n\n<li><strong>\u7f51\u7ad9\u5730\u56fe\u7d22\u5f15<\/strong>\uff1a\u5b83\u662f\u4e00\u4e2a\u7ed3\u5408\u4e86\u591a\u4e2a\u5b50\u7ad9\u70b9\u5730\u56fe\u7684XML\u6587\u4ef6\uff0c\u53ef\u4ee5\u66f4\u8f7b\u677e\u5730\u7ba1\u7406\u5927\u578b\u7f51\u7ad9\u3002<\/li>\n<\/ul>\n\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-4ed54ffd6bbffb7b553baccf8f8027dd\" style=\"color:#1a8079;font-size:33px\">2. \u6807\u51c6\u7ed3\u6784 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code><\/h2>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-e40b4577af5bec78e62226967e473053\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\n&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\n   &lt;url&gt;\n      &lt;loc&gt;https:\/\/yourdomain.com\/&lt;\/loc&gt;\n      &lt;lastmod&gt;2025-08-17&lt;\/lastmod&gt;\n      &lt;changefreq&gt;weekly&lt;\/changefreq&gt;\n      &lt;priority&gt;1.0&lt;\/priority&gt;\n   &lt;\/url&gt;\n   &lt;url&gt;\n      &lt;loc&gt;https:\/\/yourdomain.com\/about&lt;\/loc&gt;\n      &lt;lastmod&gt;2025-08-10&lt;\/lastmod&gt;\n      &lt;changefreq&gt;monthly&lt;\/changefreq&gt;\n      &lt;priority&gt;0.8&lt;\/priority&gt;\n   &lt;\/url&gt;\n&lt;\/urlset&gt;\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;loc&gt;<\/code> = \u7f51\u9875 URL<\/li>\n\n\n\n<li><code>&lt;lastmod&gt;<\/code> = \u4e0a\u6b21\u66f4\u65b0\u65e5\u671f\uff08\u683c\u5f0f <code>\u5e74-\u6708-\u65e5<\/code>)<\/li>\n\n\n\n<li><code>&lt;changefreq&gt;<\/code> = \u9884\u671f\u66f4\u65b0\u9891\u7387\uff08<code>\u603b\u662f\u3001\u6bcf\u5c0f\u65f6\u3001\u6bcf\u5929\u3001\u6bcf\u5468\u3001\u6bcf\u6708\u3001\u6bcf\u5e74\u3001\u4ece\u4e0d<\/code>)<\/li>\n\n\n\n<li><code>&lt;priority&gt;<\/code> = \u91cd\u8981\u6027\u503c\uff080.0 \u2013 1.0\uff09<\/li>\n<\/ul>\n\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-81fe5f9902deff5bc85eca39e6c34165\" style=\"color:#1a8079;font-size:28px\">3. \u521b\u5efa\u793a\u4f8b Python \u4ee3\u7801 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u4ee3\u7801\u5c06\u8bfb\u53d6 URL \u5217\u8868\u5e76\u4e3a\u60a8\u7f16\u5199 sitemap.xml \u6587\u4ef6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-9bb92c555b4aef21e53d696222667d1a\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>import datetime\n\n\ndomain = \"https:\/\/yourdomain.com\"\npages = &#91;\n    \"\/\", \n    \"\/about\", \n    \"\/contact\", \n    \"\/products\", \n    \"\/blog\"\n]\n\ntoday = datetime.date.today().isoformat()\n\nsitemap_path = \"sitemap.xml\"\n\nwith open(sitemap_path, \"w\", encoding=\"utf-8\") as f:\n    f.write('&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\\n')\n    f.write('&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\\n')\n\n    for page in pages:\n        f.write(\"  &lt;url&gt;\\n\")\n        f.write(f\"    &lt;loc&gt;{domain}{page}&lt;\/loc&gt;\\n\")\n        f.write(f\"    &lt;lastmod&gt;{today}&lt;\/lastmod&gt;\\n\")\n        f.write(\"    &lt;changefreq&gt;weekly&lt;\/changefreq&gt;\\n\")\n        f.write(\"    &lt;priority&gt;0.8&lt;\/priority&gt;\\n\")\n        f.write(\"  &lt;\/url&gt;\\n\")\n\n    f.write(\"&lt;\/urlset&gt;\\n\")\n\n\nprint(\"Sitemap index created successfully!\")\n\n<\/code><\/pre>\n\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-81126ab25a02d9f88c68df1cc553be65\" style=\"color:#1a8079;font-size:30px\">4. \u4e3a\u9759\u6001\u7f51\u7ad9\u521b\u5efa\u7ad9\u70b9\u5730\u56fe<\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-text-color has-link-color wp-elements-bbc613cd338dc0905678b7a178f71d37\" style=\"color:#e46618;font-size:25px\">4.1 \u5bf9\u4e8e\uff08\u7eaf.HTML\u6587\u4ef6\uff09\u9759\u6001\u9875\u9762<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60a8\u7684\u7f51\u7ad9 <strong>\u9759\u6001\u7f51\u7ad9\uff08\u7eaf HTML\uff09<\/strong> \u8fd8\u6709\u8bb8\u591a\u9875\u9762\uff0c\u4f8b\u5982<\/p>\n\n\n\n<pre class=\"wp-block-code has-background\" style=\"background-color:#faf2e5\" data-no-translation=\"\" data-no-auto-translation=\"\"><code><strong><em>\/index.html  \n\/about.html  \n\/contact.html  \n\/blog.html  \n\/products\/product1.html  \n\/products\/product2.html<\/em><\/strong><\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">\u4e3a\u9759\u6001\u7f51\u7ad9\u521b\u5efa Sitemap \u7684 Python \u4ee3\u7801\u793a\u4f8b<\/h5>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-74cd5f3769c73228722652c73bcd71b7\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>import os, datetime\n\n\ndomain = \"https:\/\/yourdomain.com\"\nweb_dir = \".\/public_html\"  \ntoday = datetime.date.today().isoformat()\n\nurls = &#91;]\n\n\nfor root, dirs, files in os.walk(web_dir):\n    for file in files:\n        if file.endswith(\".html\"):\n            rel_path = os.path.relpath(os.path.join(root, file), web_dir)\n            url = \"\/\" + rel_path.replace(\"\\\\\", \"\/\")\n            if url.endswith(\"index.html\"):\n                url = url.replace(\"index.html\", \"\") \n            urls.append(url)\n\n\nsitemap_path = os.path.join(web_dir, \"sitemap.xml\")\nwith open(sitemap_path, \"w\", encoding=\"utf-8\") as f:\n    f.write('&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\\n')\n    f.write('&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\\n')\n    for url in urls:\n        f.write(\"  &lt;url&gt;\\n\")\n        f.write(f\"    &lt;loc&gt;{domain}{url}&lt;\/loc&gt;\\n\")\n        f.write(f\"    &lt;lastmod&gt;{today}&lt;\/lastmod&gt;\\n\")\n        f.write(\"    &lt;changefreq&gt;monthly&lt;\/changefreq&gt;\\n\")\n        f.write(\"    &lt;priority&gt;0.5&lt;\/priority&gt;\\n\")\n        f.write(\"  &lt;\/url&gt;\\n\")\n    f.write(\"&lt;\/urlset&gt;\\n\")\n\nprint(\"Sitemap index created successfully!\")<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u4ee3\u7801\u5c06\u626b\u63cf\u60a8\u7684 Web \u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709 .html \u6587\u4ef6\u5e76\u81ea\u52a8\u7f16\u5199 sitemap.xml\u3002<\/p>\n\n\n<div class=\"gc-box notice_type icon_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><svg x=\"0px\" y=\"0px\" viewbox=\"0 0 486.463 486.463\" > <g> <g> <path d=\"M243.225,333.382c-13.6,0-25,11.4-25,25s11.4,25,25,25c13.1,0,25-11.4,24.4-24.4 C268.225,344.682,256.925,333.382,243.225,333.382z\"\/> <path d=\"M474.625,421.982c15.7-27.1,15.8-59.4,0.2-86.4l-156.6-271.2c-15.5-27.3-43.5-43.5-74.9-43.5s-59.4,16.3-74.9,43.4 l-156.8,271.5c-15.6,27.3-15.5,59.8,0.3,86.9c15.6,26.8,43.5,42.9,74.7,42.9h312.8 C430.725,465.582,458.825,449.282,474.625,421.982z M440.625,402.382c-8.7,15-24.1,23.9-41.3,23.9h-312.8 c-17,0-32.3-8.7-40.8-23.4c-8.6-14.9-8.7-32.7-0.1-47.7l156.8-271.4c8.5-14.9,23.7-23.7,40.9-23.7c17.1,0,32.4,8.9,40.9,23.8 l156.7,271.4C449.325,369.882,449.225,387.482,440.625,402.382z\"\/> <path d=\"M237.025,157.882c-11.9,3.4-19.3,14.2-19.3,27.3c0.6,7.9,1.1,15.9,1.7,23.8c1.7,30.1,3.4,59.6,5.1,89.7 c0.6,10.2,8.5,17.6,18.7,17.6c10.2,0,18.2-7.9,18.7-18.2c0-6.2,0-11.9,0.6-18.2c1.1-19.3,2.3-38.6,3.4-57.9 c0.6-12.5,1.7-25,2.3-37.5c0-4.5-0.6-8.5-2.3-12.5C260.825,160.782,248.925,155.082,237.025,157.882z\"\/> <\/g> <\/g> <\/svg><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 \u4f7f\u7528\u65b9\u6cd5<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5c06\u6b64\u4ee3\u7801\u653e\u5165\u60a8\u7684\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\uff08\u4f8b\u5982\u3002 <code>\u751f\u6210\u7ad9\u70b9\u5730\u56fe.py<\/code>)<\/li>\n\n\n\n<li>\u8fd0\u884c <code>python \u751f\u6210\u7ad9\u70b9\u5730\u56fe.py<\/code><\/li>\n\n\n\n<li>\u60a8\u5c06\u83b7\u5f97\u6587\u4ef6 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u4f4d\u4e8e\u6839\u90e8\uff08<code>public_html\/\u7ad9\u70b9\u5730\u56fe.xml<\/code>)<\/li>\n\n\n\n<li>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00 \u2192 <code>https:\/\/yourdomain.com\/sitemap.xml<\/code><\/li>\n\n\n\n<li>\u63d0\u4ea4\u81f3 Google \u548c Bing\uff08\u4f7f\u7528 Search Console \u6216 ping URL\uff09<\/li>\n<\/ol>\n\n<\/div>\n\t\t<\/div>\n\n\n<h3 class=\"wp-block-heading has-text-color has-link-color wp-elements-23fac1582b461e9e8f892b351313494b\" style=\"color:#e46618;font-size:25px\">4.2 \u5bf9\u4e8e\u4f7f\u7528.php\u6587\u4ef6\u7684\u9759\u6001\u7f51\u7ad9\uff08\u9759\u6001\u9875\u9762\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60a8\u7684\u7f51\u7ad9\u662f\u4f7f\u7528 .php \u6587\u4ef6\u7684\u9759\u6001\u7f51\u7ad9\uff08\u4f8b\u5982 index.php\u3001about.php\u3001contact.php\uff09\uff0c\u5219\u521b\u5efa sitemap.xml \u7684\u65b9\u6cd5\u4e0e .html \u60c5\u51b5\u7c7b\u4f3c\uff0c\u53ea\u662f\u6211\u4eec\u5fc5\u987b\u63d0\u53d6 .php \u6587\u4ef6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-background\" style=\"background-color:#faf2e5\" data-no-translation=\"\" data-no-auto-translation=\"\"><code><strong><em>\/index.php\n\/about.php\n\/contact.php\n\/blog.php\n\/products\/product1.php\n\/products\/product2.php<\/em><\/strong><\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">\u521b\u5efa\u7684 Python \u4ee3\u7801 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u6765\u81ea\u6587\u4ef6 <code>.php<\/code><\/h5>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-74b54ea1680cc10c12d5aa3f118addb8\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>import os, datetime\n\n\ndomain = \"https:\/\/yourdomain.com\"\nweb_dir = \".\/public_html\" \ntoday = datetime.date.today().isoformat()\n\nurls = &#91;]\n\n\nfor root, dirs, files in os.walk(web_dir):\n    for file in files:\n        if file.endswith(\".php\"):\n            rel_path = os.path.relpath(os.path.join(root, file), web_dir)\n            url = \"\/\" + rel_path.replace(\"\\\\\", \"\/\")\n            if url.endswith(\"index.php\"):\n                url = url.replace(\"index.php\", \"\")\n            urls.append(url)\n\n\nsitemap_path = os.path.join(web_dir, \"sitemap.xml\")\nwith open(sitemap_path, \"w\", encoding=\"utf-8\") as f:\n    f.write('&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\\n')\n    f.write('&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;\\n')\n    for url in urls:\n        f.write(\"  &lt;url&gt;\\n\")\n        f.write(f\"    &lt;loc&gt;{domain}{url}&lt;\/loc&gt;\\n\")\n        f.write(f\"    &lt;lastmod&gt;{today}&lt;\/lastmod&gt;\\n\")\n        f.write(\"    &lt;changefreq&gt;monthly&lt;\/changefreq&gt;\\n\")\n        f.write(\"    &lt;priority&gt;0.5&lt;\/priority&gt;\\n\")\n        f.write(\"  &lt;\/url&gt;\\n\")\n    f.write(\"&lt;\/urlset&gt;\\n\")\n\nprint(\"Sitemap index created successfully!\")<\/code><\/pre>\n\n\n<div class=\"gc-box notice_type icon_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><svg x=\"0px\" y=\"0px\" viewbox=\"0 0 486.463 486.463\" > <g> <g> <path d=\"M243.225,333.382c-13.6,0-25,11.4-25,25s11.4,25,25,25c13.1,0,25-11.4,24.4-24.4 C268.225,344.682,256.925,333.382,243.225,333.382z\"\/> <path d=\"M474.625,421.982c15.7-27.1,15.8-59.4,0.2-86.4l-156.6-271.2c-15.5-27.3-43.5-43.5-74.9-43.5s-59.4,16.3-74.9,43.4 l-156.8,271.5c-15.6,27.3-15.5,59.8,0.3,86.9c15.6,26.8,43.5,42.9,74.7,42.9h312.8 C430.725,465.582,458.825,449.282,474.625,421.982z M440.625,402.382c-8.7,15-24.1,23.9-41.3,23.9h-312.8 c-17,0-32.3-8.7-40.8-23.4c-8.6-14.9-8.7-32.7-0.1-47.7l156.8-271.4c8.5-14.9,23.7-23.7,40.9-23.7c17.1,0,32.4,8.9,40.9,23.8 l156.7,271.4C449.325,369.882,449.225,387.482,440.625,402.382z\"\/> <path d=\"M237.025,157.882c-11.9,3.4-19.3,14.2-19.3,27.3c0.6,7.9,1.1,15.9,1.7,23.8c1.7,30.1,3.4,59.6,5.1,89.7 c0.6,10.2,8.5,17.6,18.7,17.6c10.2,0,18.2-7.9,18.7-18.2c0-6.2,0-11.9,0.6-18.2c1.1-19.3,2.3-38.6,3.4-57.9 c0.6-12.5,1.7-25,2.3-37.5c0-4.5-0.6-8.5-2.3-12.5C260.825,160.782,248.925,155.082,237.025,157.882z\"\/> <\/g> <\/g> <\/svg><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 \u4f7f\u7528\u65b9\u6cd5<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5c06\u6b64\u811a\u672c\u6587\u4ef6\u653e\u5728\u60a8\u7684\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\uff08\u4f8b\u5982 <code>\u751f\u6210\u7ad9\u70b9\u5730\u56fe.py<\/code>)<\/li>\n\n\n\n<li>\u8fd0\u884c <code>python \u751f\u6210\u7ad9\u70b9\u5730\u56fe.py<\/code><\/li>\n\n\n\n<li>\u60a8\u5c06\u83b7\u5f97\u6587\u4ef6 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u4f4d\u4e8e\u6839\u90e8\uff08<code>public_html\/\u7ad9\u70b9\u5730\u56fe.xml<\/code>)<\/li>\n\n\n\n<li>\u5c1d\u8bd5\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5b83\u2192 <code>https:\/\/<code>yourdomain<\/code>.com\/sitemap.xml<\/code><\/li>\n\n\n\n<li>\u628a\u5b83\u62ff\u8d70 <strong>\u63d0\u4ea4\u81f3 Google Search Console\/Bing \u7f51\u7ad9\u7ba1\u7406\u5458<\/strong><\/li>\n<\/ol>\n\n<\/div>\n\t\t<\/div>\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-1d0e923835c66ddc8b439676f1ae128f\" style=\"color:#1a8079;font-size:30px\">5. \u521b\u5efa sitemap.xml <strong>\u5171\u4eab\u4e3b\u673a<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60a8\u4f7f\u7528\u5171\u4eab\u4e3b\u673a\uff0c\u5219\u9650\u5236\u5728\u4e8e\u60a8\u4e0d\u80fd\u76f4\u63a5\u5728\u5171\u4eab\u4e3b\u673a\u4e0a\u8fd0\u884c Python \u6587\u4ef6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-text-color has-link-color wp-elements-6fb5bfe6424542ff38b624517cb57c7c\" style=\"color:#e46618;font-size:27px\">\u56e0\u6b64\uff0c\u6709\u4e24\u4e2a\u9009\u9879\u53ef\u4ee5\u81ea\u52a8\u751f\u6210 sitemap.xml\u3002<\/h3>\n\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:0px;\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h4 class=\"wp-block-heading has-text-color has-link-color wp-elements-2c8640e04290cf046f65eb1aea749dff\" style=\"color:#922dae;font-size:20px\">\ud83d\udd39 \u9009\u9879 1\uff08\u6700\u7b80\u5355\uff09\u2014\u2014\u4f7f\u7528\u672c\u5730\u673a\u5668\u521b\u5efa\u548c\u4e0a\u4f20\u3002<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5728\u4f60\u7684\u673a\u5668\u4e0a\u5b89\u88c5 Python<\/strong> \uff08Windows\/Mac\uff09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c Python \u811a\u672c \u2192 \u60a8\u5c06\u83b7\u5f97\u4e00\u4e2a\u6587\u4ef6 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08Mac\/Linux\uff09\u5e76\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code has-primary-color has-orange-background-color has-text-color has-background has-link-color wp-elements-22700d9d69990481ae4f3467d652115e\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>python generate_sitemap.py<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u4f20\u6587\u4ef6 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u8f6c\u81f3 <code>public_html\/<\/code> \u901a\u8fc7\u6258\u7ba1 <strong>\u6587\u4ef6\u7ba1\u7406\u5668\/FTP<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u5f80\u6d4f\u89c8\u5668 \u2192<\/p>\n\n\n\n<pre class=\"wp-block-code has-primary-color has-orange-background-color has-text-color has-background has-link-color wp-elements-4c40ab6e95de4767b35e8fb6aea06158\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>https:&#47;&#47;yourdomain.com\/sitemap.xml<\/code><\/pre>\n\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:0px;\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h4 class=\"wp-block-heading has-text-color has-link-color wp-elements-c60cce5e7233d756e1a3bfa2ac3acf73\" style=\"color:#922dae;font-size:20px\">\ud83d\udd39 \u9009\u9879 2 \u2014 \u4f7f\u7528 PHP \u5728\u60a8\u7684\u4e3b\u673a\u4e0a\u521b\u5efa\u7ad9\u70b9\u5730\u56fe\u3002<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u60a8\u4e0d\u60f3\u5728\u672c\u5730\u8fd0\u884c Python\uff0c\u60a8\u53ef\u4ee5\u7f16\u5199 PHP \u4ee3\u7801\u6765\u81ea\u52a8\u751f\u6210 sitemap.xml\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-cc889b7e760069b369c38ad22f15fc95\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>&lt;?php\n$domain = \"https:\/\/yourdomain.com\";\n$web_dir = __DIR__; \/\/ public_html\n$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($web_dir));\n$urls = &#91;];\n\nforeach ($files as $file) {\n    if ($file-&gt;isFile() &amp;&amp; pathinfo($file, PATHINFO_EXTENSION) === \"php\") {\n        $path = str_replace($web_dir, \"\", $file-&gt;getPathname());\n        $url = str_replace(\"\\\\\", \"\/\", $path);\n        if (basename($url) === \"index.php\") {\n            $url = str_replace(\"index.php\", \"\", $url);\n        }\n        $urls&#91;] = $url;\n    }\n}\n\n$today = date(\"Y-m-d\");\n$sitemap = '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;' . \"\\n\";\n$sitemap .= '&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;' . \"\\n\";\n\nforeach ($urls as $url) {\n    $sitemap .= \"  &lt;url&gt;\\n\";\n    $sitemap .= \"    &lt;loc&gt;{$domain}{$url}&lt;\/loc&gt;\\n\";\n    $sitemap .= \"    &lt;lastmod&gt;{$today}&lt;\/lastmod&gt;\\n\";\n    $sitemap .= \"    &lt;changefreq&gt;monthly&lt;\/changefreq&gt;\\n\";\n    $sitemap .= \"    &lt;priority&gt;0.5&lt;\/priority&gt;\\n\";\n    $sitemap .= \"  &lt;\/url&gt;\\n\";\n}\n\n$sitemap .= \"&lt;\/urlset&gt;\";\n\nfile_put_contents($web_dir . \"\/sitemap.xml\", $sitemap);\n\necho \"\u2705 Sitemap created at {$domain}\/sitemap.xml\";\n?&gt;\n<\/code><\/pre>\n\n\n\n<h6 class=\"wp-block-heading\">\ud83d\udd39 \u4f7f\u7528\u65b9\u6cd5<\/h6>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53e6\u5b58\u4e3a\u6587\u4ef6 <code>\u751f\u6210\u7ad9\u70b9\u5730\u56fe.php<\/code><\/li>\n\n\n\n<li>\u4e0a\u4f20\u81f3 <code>public_html\/<\/code><\/li>\n\n\n\n<li>\u901a\u8fc7\u7f51\u7edc\u8c03\u7528\u6587\u4ef6\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-orange-background-color has-background\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>https:&#47;&#47;yourdomain.com\/generate_sitemap.php<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u60a8\u5c06\u83b7\u5f97\u6587\u4ef6 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u7acb\u5373\u5728\u6839<\/li>\n<\/ul>\n\n<\/div>\n\t\t<\/div>\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box border_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-f241334b63c73b813a8ec88f8f54ab0a\" style=\"color:#1a8079;font-size:33px\">6.\u6709\u4e00\u4e2a\u65b0\u7684sitemap.xml\u9875\u9762\uff0c\u4f1a\u81ea\u52a8\u66f4\u65b0\u3002<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f60\u60f3\u7ed9\u4e88 <strong>\u6dfb\u52a0\u65b0\u9875\u9762\u65f6\uff08.php\uff09<\/strong> \u2192 <code>\u7ad9\u70b9\u5730\u56fe.xml<\/code> \u5b83\u662f\u81ea\u52a8\u66f4\u65b0\u7684\uff0c\u7531\u4e8ePython\u4e0d\u80fd\u76f4\u63a5\u8fd0\u884c\uff0c\u6211\u4eec\u5c06\u4f7f\u7528PHP\u811a\u672c\u6bcf\u6b21\u68c0\u67e5public_html\u4e2d\u7684.php\u6587\u4ef6\u5e76\u7f16\u5199\u65b0\u7684sitemap.xml\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-text-color has-link-color wp-elements-fdae2986c5d64973b5dbb69f9e471117\" style=\"color:#e46618;font-size:25px\">PHP \u4ee3\u7801\uff1a\u6bcf\u6b21\u8fd0\u884c\u65f6\u81ea\u52a8\u751f\u6210\u7ad9\u70b9\u5730\u56fe<\/h3>\n\n\n\n<pre class=\"wp-block-code has-layout-color has-primary-background-color has-text-color has-background has-link-color wp-elements-eb766c9d57cc70511bd3982919b13d59\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>&lt;?php\n\n$domain = \"https:\/\/yourdomain.com\";\n$web_dir = __DIR__; \/\/ public_html\n$today = date(\"Y-m-d\");\n\n$files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($web_dir));\n$urls = &#91;];\n\nforeach ($files as $file) {\n    if ($file-&gt;isFile() &amp;&amp; pathinfo($file, PATHINFO_EXTENSION) === \"php\") {\n        $path = str_replace($web_dir, \"\", $file-&gt;getPathname());\n        $url = str_replace(\"\\\\\", \"\/\", $path);\n\n        if (basename($url) === \"index.php\") {\n            $url = str_replace(\"index.php\", \"\", $url);\n        }\n\n        $urls&#91;] = $url;\n    }\n}\n\n\/\/  sitemap.xml\n$sitemap = '&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;' . \"\\n\";\n$sitemap .= '&lt;urlset xmlns=\"http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9\"&gt;' . \"\\n\";\n\nforeach ($urls as $url) {\n    $sitemap .= \"  &lt;url&gt;\\n\";\n    $sitemap .= \"    &lt;loc&gt;{$domain}{$url}&lt;\/loc&gt;\\n\";\n    $sitemap .= \"    &lt;lastmod&gt;{$today}&lt;\/lastmod&gt;\\n\";\n    $sitemap .= \"    &lt;changefreq&gt;monthly&lt;\/changefreq&gt;\\n\";\n    $sitemap .= \"    &lt;priority&gt;0.5&lt;\/priority&gt;\\n\";\n    $sitemap .= \"  &lt;\/url&gt;\\n\";\n}\n\n$sitemap .= \"&lt;\/urlset&gt;\";\n\nfile_put_contents($web_dir . \"\/sitemap.xml\", $sitemap);\n\necho \"\u2705 Sitemap updated at {$domain}\/sitemap.xml\";\n?&gt;\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39 \u5982\u4f55\u4f7f\u7528<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5c06generate_sitemap.php\u6587\u4ef6\u4e0a\u4f20\u5230public_html\u3002<\/li>\n\n\n\n<li>\u5728\u6d4f\u89c8\u5668\u4e2d\u8c03\u7528\u8be5\u6587\u4ef6\uff1a<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-primary-color has-orange-background-color has-text-color has-background has-link-color wp-elements-ec72b115d2d962a048550e6f74b47b85\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>https:&#47;&#47;yourdomain.com\/generate_sitemap.php<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u2192 \u5b83\u6bcf\u6b21\u90fd\u4f1a\u91cd\u65b0\u751f\u6210\uff08\u6216\u66f4\u65b0\uff09sitemap.xml\u3002<\/li>\n\n\n\n<li>\u6dfb\u52a0\u65b0\u7684 .php \u6587\u4ef6\u65f6 \u2192 \u53ea\u9700\u518d\u6b21\u8fd0\u884c\u6b64\u6587\u4ef6\uff0c\u5b83\u5c31\u4f1a\u66f4\u65b0\u7ad9\u70b9\u5730\u56fe\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\ud83d\udd39\u771f\u6b63\u5b9e\u73b0\u81ea\u52a8\u5316\uff08\u8bbe\u7f6e Cron Job\uff0c\u65e0\u9700\u81ea\u5df1\u6309\uff09<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 Hosting \u7684 Cron Job \u6bcf\u5929\/\u6bcf\u5468\u8fd0\u884c generate_sitemap.php\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6258\u7ba1 hPanel \u4e2d\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8f6c\u81f3 <strong>\u9ad8\u7ea7 \u2192 Cron \u4f5c\u4e1a<\/strong><\/li>\n\n\n\n<li>\u6dfb\u52a0 Cron Job\uff0c\u4f8b\u5982\uff1a <code>php \/home\/\u7528\u6237\u540d\/public_html\/generate_sitemap.php<\/code> <\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-primary-color has-text-color has-background has-link-color wp-elements-9fba2ebe1fe4129b94a707cbf2e9fc67\" style=\"background-color:#c8e5ea\" data-no-translation=\"\" data-no-auto-translation=\"\"><code>php \/home\/username\/public_html\/generate_sitemap.php<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7136\u540e\u5c06\u65f6\u95f4\u8bbe\u7f6e\u4e3a <strong>\u6bcf\u5929\u4e00\u6b21<\/strong><\/li>\n<\/ul>\n\n<\/div>\n\t\t<\/div>\n\n<div class=\"gc-box notice_type icon_type\" style=\"text-align:left;border-radius:20px;box-shadow: 0 10px 10px #00000007\">\n\t\t\t<div class=\"gc-box-icon\"><svg x=\"0px\" y=\"0px\" viewbox=\"0 0 486.463 486.463\" > <g> <g> <path d=\"M243.225,333.382c-13.6,0-25,11.4-25,25s11.4,25,25,25c13.1,0,25-11.4,24.4-24.4 C268.225,344.682,256.925,333.382,243.225,333.382z\"\/> <path d=\"M474.625,421.982c15.7-27.1,15.8-59.4,0.2-86.4l-156.6-271.2c-15.5-27.3-43.5-43.5-74.9-43.5s-59.4,16.3-74.9,43.4 l-156.8,271.5c-15.6,27.3-15.5,59.8,0.3,86.9c15.6,26.8,43.5,42.9,74.7,42.9h312.8 C430.725,465.582,458.825,449.282,474.625,421.982z M440.625,402.382c-8.7,15-24.1,23.9-41.3,23.9h-312.8 c-17,0-32.3-8.7-40.8-23.4c-8.6-14.9-8.7-32.7-0.1-47.7l156.8-271.4c8.5-14.9,23.7-23.7,40.9-23.7c17.1,0,32.4,8.9,40.9,23.8 l156.7,271.4C449.325,369.882,449.225,387.482,440.625,402.382z\"\/> <path d=\"M237.025,157.882c-11.9,3.4-19.3,14.2-19.3,27.3c0.6,7.9,1.1,15.9,1.7,23.8c1.7,30.1,3.4,59.6,5.1,89.7 c0.6,10.2,8.5,17.6,18.7,17.6c10.2,0,18.2-7.9,18.7-18.2c0-6.2,0-11.9,0.6-18.2c1.1-19.3,2.3-38.6,3.4-57.9 c0.6-12.5,1.7-25,2.3-37.5c0-4.5-0.6-8.5-2.3-12.5C260.825,160.782,248.925,155.082,237.025,157.882z\"\/> <\/g> <\/g> <\/svg><\/div>\n\t\t\t\n\t\t\t<div class=\"gc-box-text\">\n\n<p class=\"wp-block-paragraph\">\u5efa\u8bae\u4f7f\u7528\u7ad9\u70b9\u5730\u56fe\u7d22\u5f15\u6587\u4ef6\u6765\u7ba1\u7406\u7ad9\u70b9\u5730\u56fe\u3002\u5982\u679c\u7ad9\u70b9\u5730\u56fe\u8d85\u51fa\u5927\u5c0f\u9650\u5236\uff0c\u5efa\u8bae\u5c06\u5176\u62c6\u5206\u4e3a\u591a\u4e2a\u6587\u4ef6\uff0c\u5e76\u4f7f\u7528\u7d22\u5f15\u6587\u4ef6\u5728 Search Console \u4e2d\u540c\u65f6\u4e3a\u6bcf\u4e2a\u7f51\u7ad9\u63d0\u4ea4\u6700\u591a 500 \u4e2a\u6587\u4ef6\u3002\u7d22\u5f15\u6587\u4ef6\u7684 XML \u683c\u5f0f\u4e0e\u666e\u901a\u7ad9\u70b9\u5730\u56fe\u7c7b\u4f3c\uff0c\u5e76\u4e14\u5fc5\u987b\u4f4d\u4e8e\u540c\u4e00\u76ee\u5f55\u6216\u66f4\u6df1\u7684\u76ee\u5f55\u4e2d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u66f4\u591a\u4fe1\u606f <a href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/sitemaps\/large-sitemaps\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/developers.google.com<\/a><\/p>\n\n<\/div>\n\t\t<\/div>\n\n<style scoped>.gc-accordion{margin-bottom:25px}.gc-accordion .gc-accordion-item{margin:10px 0 0}.gc-accordion .gc-accordion-item.gcclose .gc-accordion-item__content{display:none}.gc-accordion .gc-accordion-item.gcopen .gc-accordion-item__title .gciconafter{transform:rotate(0)}.gc-accordion .gc-accordion-item:first-of-type{margin-top:0}.gc-accordion .gc-accordion-item__heading{outline:0;text-decoration:none;font-weight:400 !important;font-size:15px !important;line-height:21px !important;margin:0 !important;padding:15px !important;}.gc-accordion .gc-accordion-item__title{z-index:1;position:relative;display:block;margin:0;background:none #f9f9f9;border:1px solid #ddd;cursor:pointer;transition:all .3s ease-in-out}.gc-accordion .gc-accordion-item__title span.iconfortoggle{display:block;position:absolute;height:14px;width:14px;right:20px;top:18px}.gc-accordion .gc-accordion-item__title span.iconfortoggle .gciconbefore{content:\"\";width:14px;height:3px;border-radius:2px;background-color:#111;position:absolute;top:6px}.gc-accordion .gc-accordion-item__title span.iconfortoggle .gciconafter{content:\"\";width:14px;height:3px;border-radius:2px;background-color:#111;position:absolute;top:6px;transform:rotate(90deg);transition:all .3s ease-in-out}.gc-accordion .gc-accordion-item__title:hover{background:none #eee}.gc-accordion .gc-accordion-item__content{z-index:0;position:relative;padding:15px;border:1px solid #ddd;border-top:none;background:#fff}.gc-accordion .gc-accordion-item__content.stuckMoveDownOpacity{-webkit-animation:stuckMoveDownOpacity .6s;animation:stuckMoveDownOpacity .6s}.gc-accordion .gc-accordion-item__text{font-size:16px;font-weight:400;line-height:1.75}@keyframes stuckMoveDownOpacity{0%{transform:translateY(-15px);opacity:0}100%{transform:translateY(0);opacity:1}}<\/style><div class=\"gc-accordion\" itemscope=\"\" itemtype=\"https:\/\/schema.org\/FAQPage\"><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">\u4ec0\u4e48\u662f Sitemap.xml\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u4e00\u4e2a XML \u6587\u4ef6\uff0c\u544a\u8bc9 Google \u548c\u641c\u7d22\u5f15\u64ce\u54ea\u4e9b\u9875\u9762\u88ab\u5305\u542b\u5728\u5185\uff0c\u4ee5\u53ca\u6392\u540d\u4fe1\u606f\uff0c\u4f8b\u5982\u4e0a\u6b21\u4fee\u6539\u65e5\u671f (lastmod)\u3001\u66f4\u6539\u9891\u7387 (changefreq) \u548c\u4f18\u5148\u7ea7 (priority)\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">\u662f\u5426\u9700\u8981 sitemap.xml\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u8fd9\u4e0d\u662f\u5fc5\u9700\u7684\uff0c\u4f46\u5b83\u53ef\u4ee5\u5e2e\u52a9\u641c\u7d22\u5f15\u64ce\u66f4\u5feb\u5730\u7d22\u5f15\u60a8\u7684\u7f51\u9875\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u8f83\u5927\u7684\u7f51\u7ad9\u6216\u7ecf\u5e38\u6dfb\u52a0\u65b0\u7f51\u9875\u7684\u7f51\u7ad9\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">Sitemap.xml \u4e0e robots.txt \u6709\u4f55\u4e0d\u540c\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">robots.txt \u2192 \u544a\u8bc9\u641c\u7d22\u5f15\u64ce\u54ea\u4e9b\u9875\u9762\u9700\u8981\u963b\u6b62\u8bbf\u95ee\uff1bsitemap.xml \u2192 \u544a\u8bc9\u641c\u7d22\u5f15\u64ce\u54ea\u4e9b\u9875\u9762\u9700\u8981\u88ab\u5305\u542b\u548c\u7d22\u5f15\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">PHP\/HTML \u7f51\u7ad9\u53ef\u4ee5\u4f7f\u7528 sitemap.xml \u5417\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u5f53\u7136\uff01Sitemap.xml \u5e76\u4e0d\u5173\u5fc3\u6587\u4ef6\u662f PHP\u3001HTML \u8fd8\u662f\u52a8\u6001 URL\uff0c\u5b83\u53ea\u544a\u8bc9\u60a8\u7f51\u9875\u7684 URL\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">\u6211\u5e94\u8be5\u591a\u4e45\u66f4\u65b0\u4e00\u6b21 sitemap.xml\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u5982\u679c\u9891\u7e41\u6dfb\u52a0\u65b0\u9875\u9762 \u2192 \u60a8\u5e94\u8be5\u7acb\u5373\u66f4\u65b0 * \u5982\u679c\u7f51\u7ad9\u7a33\u5b9a \u2192 \u6709\u53d8\u5316\u65f6\u8fdb\u884c\u66f4\u65b0<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">sitemap.xml \u662f\u5426\u592a\u5927\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">XML \u6587\u4ef6\u6700\u5927\u5927\u5c0f = 50MB\uff0c\u6bcf\u4e2a\u6587\u4ef6\u6700\u591a\u5305\u542b 50,000 \u4e2a URL\u3002\u5982\u679c\u8d85\u8fc7\u6b64\u9650\u5236\uff0c\u8bf7\u62c6\u5206\u6210\u591a\u4e2a\u6587\u4ef6\u5e76\u521b\u5efa\u7ad9\u70b9\u5730\u56fe\u7d22\u5f15\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">\u7ad9\u70b9\u5730\u56fe\u4e2d\u53ef\u4ee5\u5305\u542b\u52a8\u6001 URL\uff08\u4f8b\u5982\u67e5\u8be2\u5b57\u7b26\u4e32\uff09\u5417\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u53ef\u4ee5\uff0c\u4f46\u60a8\u5e94\u8be5\u4f7f\u7528 Google \u53ef\u4ee5\u5b9e\u9645\u7d22\u5f15\u7684 URL\uff0c\u5e76\u907f\u514d\u4f7f\u7528\u4ea7\u751f\u91cd\u590d\u5185\u5bb9\u7684 URL\u3002<\/div><\/div><\/div><div class=\"gc-accordion-item gcopen\" itemscope=\"\" itemprop=\"mainEntity\" itemtype=\"https:\/\/schema.org\/Question\"><div class=\"gc-accordion-item__title\" style=\"background-color:#c6e3f7;border-color:#c6e3f7;\"><h3 class=\"gc-accordion-item__heading\" itemprop=\"name\" style=\"\">\u5982\u4f55\u81ea\u52a8\u751f\u6210sitemap.xml\uff1f<\/h3><span class=\"iconfortoggle\"><span class=\"gciconbefore\" style=\"\"><\/span><span class=\"gciconafter\" style=\"\"><\/span><\/span><\/div><div class=\"gc-accordion-item__content\" style=\"\" itemscope=\"\" itemprop=\"acceptedAnswer\" itemtype=\"https:\/\/schema.org\/Answer\"><div class=\"gc-accordion-item__text\" itemprop=\"text\">\u4f7f\u7528 PHP \u811a\u672c\uff08\u9002\u7528\u4e8e\u5171\u4eab\u4e3b\u673a\uff09\u4f7f\u7528 Python \/ \u5916\u90e8\u811a\u672c\u5e76\u4e0a\u4f20\u4f7f\u7528\u63d2\u4ef6 \/ CMS\uff0c\u4f8b\u5982 WordPress \u63d0\u4f9b\u7684\u751f\u6210\u5668\u3002<\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"\u9010\u6b65\u4f7f\u7528 Python \u4ee3\u7801\u521b\u5efa sitemap.xml \u6587\u4ef6\uff0c\u5e2e\u52a9\u641c\u7d22\u5f15\u64ce\u8bc6\u522b\u6211\u4eec\u7684\u7f51\u9875\u3002\u5176\u4e2d\u5305\u542b\u4e00\u4e2a\u4f7f\u7528 .html \u548c .php \u6587\u4ef6\u7684\u9759\u6001\u7f51\u7ad9\u793a\u4f8b\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u793a\u4f8b\u4ee5\u53ca\u5982\u4f55\u901a\u8fc7 Search Console \u6216 ping URL \u5c06\u5176\u53d1\u9001\u5230 Google \u548c Bing \u7684\u8bf4\u660e\u3002","protected":false},"author":1,"featured_media":2746,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[23,28],"tags":[],"class_list":["post-2699","post","type-post","status-publish","format-standard","has-post-thumbnail","category-website-creation","category-html-css-javascript","cs-entry"],"_links":{"self":[{"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/posts\/2699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/comments?post=2699"}],"version-history":[{"count":36,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/posts\/2699\/revisions"}],"predecessor-version":[{"id":2741,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/posts\/2699\/revisions\/2741"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/media\/2746"}],"wp:attachment":[{"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/media?parent=2699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/categories?post=2699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/siammakemoney.com\/zh\/wp-json\/wp\/v2\/tags?post=2699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}