{"id":118,"date":"2022-10-10T21:06:54","date_gmt":"2022-10-10T12:06:54","guid":{"rendered":"http:\/\/52.196.21.54.nip.io\/techblog\/?p=118"},"modified":"2023-02-22T23:41:57","modified_gmt":"2023-02-22T14:41:57","slug":"wp-sitemap-xml%e3%81%8b%e3%82%89%e4%b8%8d%e8%a6%81%e3%81%aa%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e9%99%a4%e5%a4%96%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2022\/10\/10\/118\/","title":{"rendered":"wp-sitemap.xml\u304b\u3089\u4e0d\u8981\u306a\u30da\u30fc\u30b8\u3092\u9664\u5916\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>WordPress\u306eXML\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306f\u4fbf\u5229\u306a\u306e\u3067\u4f7f\u3063\u3066\u3044\u308b\u304c\u3001\u30b5\u30a4\u30c8\u306b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3057\u305f\u304f\u306a\u3044\u30da\u30fc\u30b8\u3082\u3042\u308b\u3068\u601d\u3046\u3002<br>\u305f\u3068\u3048\u3070\u5c0f\u898f\u6a21\u306a\u30b5\u30a4\u30c8\u3060\u3068\u3001\u30ab\u30c6\u30b4\u30ea\u3084\u30bf\u30b0\u6a5f\u80fd\u306a\u3093\u3066\u4f7f\u308f\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3002<br><code>noindex<\/code>\u3064\u3051\u3066\u3044\u308b\u30da\u30fc\u30b8\u304cXML\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306b\u8f09\u3063\u3066\u3044\u308b\u3068\u3001Google\u30b5\u30fc\u30c1\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u6012\u3089\u308c\u305f\u308a\u3082\u3059\u308b\u3002<\/p>\n\n\n\n<p>\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u9664\u5916\u3059\u308b\u5834\u5408\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('wp_sitemaps_post_types', function ( $post_types ) {\n\tunset( $post_types&#91;'post'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306b\u6295\u7a3f\u3092\u51fa\u529b\u3057\u306a\u3044\n\tunset( $post_types&#91;'page'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306b\u56fa\u5b9a\u30da\u30fc\u30b8\u3092\u51fa\u529b\u3057\u306a\u3044\n\tunset( $post_types&#91;'types'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306btypes\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u51fa\u529b\u3057\u306a\u3044\n\treturn $post_types;\n});<\/code><\/pre>\n\n\n\n<p>\u30ab\u30c6\u30b4\u30ea\u30fc\u30fb\u30bf\u30b0\u3092\u9664\u5916\u3059\u308b\u5834\u5408\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('wp_sitemaps_taxonomies', function ( $taxonomies ) {\n\tunset( $taxonomies&#91;'category'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306b\u30ab\u30c6\u30b4\u30ea\u30fc\u3092\u51fa\u529b\u3057\u306a\u3044\n\tunset( $taxonomies&#91;'post_tag'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306b\u30bf\u30b0\u3092\u51fa\u529b\u3057\u306a\u3044\n\tunset( $taxonomies&#91;'types'] ); \/\/\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306btypes\u30ab\u30b9\u30bf\u30e0\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u3092\u51fa\u529b\u3057\u306a\u3044\n\treturn $taxonomies;\n});<\/code><\/pre>\n\n\n\n<p>\u8457\u8005\u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u6d88\u3059\u5834\u5408\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>add_filter('wp_sitemaps_add_provider', function ( $provider, $name ) {\n    if ( 'users' === $name ) {\n        return false;\n    }\n    return $provider;\n},  10, 2);<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"WordPress\u306eXML\u30b5\u30a4\u30c8\u30de\u30c3\u30d7\u306f\u4fbf\u5229\u306a\u306e\u3067\u4f7f\u3063\u3066\u3044\u308b\u304c\u3001\u30b5\u30a4\u30c8\u306b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3057\u305f\u304f\u306a\u3044\u30da\u30fc\u30b8\u3082\u3042\u308b\u3068\u601d\u3046\u3002\u305f\u3068\u3048\u3070\u5c0f\u898f\u6a21\u306a\u30b5\u30a4\u30c8\u3060\u3068\u3001\u30ab\u30c6\u30b4\u30ea\u3084\u30bf\u30b0\u6a5f\u80fd\u306a\u3093\u3066\u4f7f\u308f\u306a\u304b\u3063\u305f\u308a\u3059\u308b\u3002noindex\u3064\u3051\u3066\u3044\u308b\u30da\u30fc\u30b8\u304c [&hellip;]","protected":false},"author":1,"featured_media":137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[39,47],"tags":[54,52,10],"class_list":["post-118","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","category-frontend","tag-seo","tag-wordpress","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2022\/10\/sitemap-gcbe57e2ab_1920.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":5,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":192,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/118\/revisions\/192"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/137"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}