[WordPress] 外掛分享: Sewn In XML Sitemap

WordPress 外掛 Sewn In XML Sitemap 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Sewn In XML Sitemap」是 2014-08-12 上架。
  • 目前有 40 個安裝啟用數。
  • 上一次更新是 2017-09-02,距離現在已有 2801 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.6.1 以上版本才可以安裝。
  • 有 4 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

ekaj | jcow |

外掛標籤

seo | sitemap | xml sitemap |

內容簡介

2.0.3 版本更改了默認的文章類型,從僅“post”和“page”更改為全部公開的文章類型,除了“attachment”。這是一種更清潔的方法,但可能需要進行自定義設置。下面有更多有關自定義設置的信息。

本網站不會通知新的支持主題,因此請通過我們的表格發送聯繫以通知新的主題,以獲得更快的回應。

簡單的方式在保存頁面或文章時自動生成 XML 網站地圖。非常簡單,沒有你不會使用的冗餘或額外功能。有兩種主要的自定義設置可供選擇。

選擇要添加的文章類型(默認為文章和頁面)
在所有包含的文章類型中添加一個元框以防止將單個文章添加到網站地圖中

它也可以與我們的Sewn In Simple SEO插件很好地配合使用。當兩者都安裝時,它們會集成在一起。

控制添加文章類型
/**
* 完全替換 XML 網站地圖中的文章類型
*
* 這將完全替換默認設置。返回: array('news','event')
*
* 結果是刪除“post”和“page”文章類型,並添加“news”和“event”文章類型
*
* @param array $post_types 要添加到 XML 網站地圖的文章類型列表
* @return array $post_types 修改過的文章類型列表
*/
add_filter( 'sewn/seo/post_types', 'custom_seo_post_types' );
function custom_seo_post_types( $post_types )
{
$post_types = array('news','event');
return $post_types;
}

從網站地圖中刪除特定文章

在包含在網站地圖中的每個文章類型中添加了一個勾選框。勾選框將從網站地圖中刪除該特定項目。

此勾選框還將從 wp_list_pages 中刪除文章,您可以使用以下過濾器關閉它:

add_filter( 'sewn/sitemap/wp_list_pages', '__return_false' );

/**
* 這個過濾器是在 2.0.3 中新增的
*
* 程式設計方式刪除特定文章。這個功能可以放到 functions.php 或插件中。
*
* 這個例子會刪除所有具有“test”設置的文章。
*/
add_filter( 'sewn/sitemap/post', 'custom_remove_test_posts', 10, 2 );
function custom_remove_test_posts( $value, $post )
{
$status = get_metadata( 'post', $post->ID, 'test', true );
if ( $status ) {
$value = false;
}
return $value;
}

更改文章類型的頻率,也可以通過檢查 $post-ID 或 $post->post_name 以單獨使用
/**
* 更改 XML 中的網站地圖頻率,默認為“每月”
*
* 選項:always、hourly、daily、weekly、monthly、yearly、never
*/
add_filter( 'sewn/sitemap/frequency', 'custom_sitemap_frequency', 10, 2 );
function custom_sitemap_frequency( $frequency, $post )
{
if ( 'news' == get_post_type($post) ) {
$frequency = 'daily';
}
return $frequency;
}

相容性

可以與Sewn In Simple SEO插件一起使用。當安裝時,XML 網站地圖勾選框與 SEO 欄位集成,此插件將使用 SEO 文章類型。目標是保持非常簡單和集成。

原文外掛簡介

2.0.3 changed default post types used from only ‘post’ and ‘page’ to ALL public post types except “attachment”. This is a cleaner approach, but may require customization. There is more info on customization below.
This site doesn’t notify of new support threads, so send a contact through our form to notify of a new thread for a quicker response.
Simple way to automatically generate XML Sitemaps when a page or post is saved. Very simple, no cruft or extra features you won’t use. There are two main customizations available.

Choose which post types are added (posts and pages by default)
Adds a meta box to all included post types to remove single posts from being added to the sitemap

It also works well with our Sewn In Simple SEO plugin. When both are installed, they integrate together.
Control what post types are added
/**
* Completely replace the post types in the XML sitemap
*
* This will replace the default completely. Returns: array('news','event')
*
* The result is to remove 'post' and 'page' post types and to add 'news' and
* 'event' post types
*
* @param array $post_types List of post types to be added to the XML Sitemap
* @return array $post_types Modified list of post types
*/
add_filter( 'sewn/seo/post_types', 'custom_seo_post_types' );
function custom_seo_post_types( $post_types )
{
$post_types = array('news','event');
return $post_types;
}

Remove a specific post from the sitemap
A checkbox is added to each post type that is included in the sitemap. Checking it will remove that specific item from the sitemap.
This checkbox also removes posts from wp_list_pages, you can turn that off using this filter:
add_filter( 'sewn/sitemap/wp_list_pages', '__return_false' );

/**
* This filter arrived in 2.0.3
*
* Remove specific posts programatically. This could go into functions.php or a plugin.
*
* This example removes all posts that have post meta field of "test" set.
*/
add_filter( 'sewn/sitemap/post', 'custom_remove_test_posts', 10, 2 );
function custom_remove_test_posts( $value, $post )
{
$status = get_metadata( 'post', $post->ID, 'test', true );
if ( $status ) {
$value = false;
}
return $value;
}

Change frequency for a post type, could also be used an a single post basis by checking the the $post-ID or $post->post_name
/**
* Change sitemap frequency in XML, default is "monthly"
*
* options: always, hourly, daily, weekly, monthly, yearly, never
*/
add_filter( 'sewn/sitemap/frequency', 'custom_sitemap_frequency', 10, 2 );
function custom_sitemap_frequency( $frequency, $post )
{
if ( 'news' == get_post_type($post) ) {
$frequency = 'daily';
}
return $frequency;
}

Compatibility
Works with the Sewn In Simple SEO plugin. When installed, the XML sitemap checkbox integrates with the SEO fields and this plugin will use the SEO post types. The goal is to keep things very simple and integrated.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Sewn In XML Sitemap」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


1.0.4 | 2.0.0 | 2.0.1 | 2.0.2 | 2.0.3 | 2.0.4 | 2.0.5 | 2.0.6 | trunk |

延伸相關外掛(你可能也想知道)

  • Yoast SEO 》Yoast SEO:#1 WordPress SEO 外掛, 自 2008 年以來,Yoast SEO 幫助全球數百萬個網站在搜尋引擎中排名更高。, Yoast 的使命是為所有人提供 SEO 服務。我們的...。
  • LiteSpeed Cache 》LiteSpeed Cache for WordPress(LSCWP)是一種全方位的網站加速外掛,包括獨家的伺服器層快取和一系列的優化功能。, LSCWP 支援 WordPress Multisite 及大多...。
  • Rank Math SEO – AI SEO Tools to Dominate SEO Rankings 》Rank Math SEO – WordPress 最佳 SEO 外掛, 第一款使用人工智慧 (AI) 的 WordPress SEO 外掛 🦾, ★★★★★, SEO 是任何網站最穩定的流量來源。我們創建了 Rank M...。
  • All in One SEO – Powerful SEO Plugin to Boost SEO Rankings & Increase Traffic 》assic Editor, so you don't even need to leave your WordPress dashboard to optimize your content., Here’s what another smart WordPress user ha...。
  • XML Sitemap Generator for Google 》使用這個外掛程式可以大大改善 SEO,產生特殊的 XML 網站地圖,幫助 Google、Bing、Yahoo 和 Ask.com 等搜索引擎更好地索引您的網站。, 有了這樣的網站地圖,...。
  • SpeedyCache – Cache, Optimization, Performance 》SpeedyCache 是一款 WordPress 外掛,能透過網頁快取、最小化檔案和檔案壓縮的方式,幫助您減少網站載入時間。, 您可以在 https://speedycache.com/docs 找到...。
  • SEOPress – On-site SEO 》最佳的 WordPress SEO 外掛程式,與所有網頁建構工具和佈景主題全部整合!, 現在增加了 AI 功能,自動產生 meta 標題和描述!, SEOPress 是一個強大的 WordPr...。
  • Broken Link Checker by AIOSEO – Easily Fix/Monitor Internal and External links 》總結:Broken Link Checker by AIOSEO 是一款必備的工具,可以確保您的網站上所有的內部和外部連結都能正常運作。快速檢查您的網站中的錯誤鏈接,並輕鬆修復...。
  • PS Auto Sitemap 》PS Auto Sitemap 是一個 WordPress 外掛,自動從您的 WordPress 網站生成網站地圖頁面。, 對於初學者來說,安裝非常容易;對於專家來說,定制也非常容易。您...。
  • Cloudflare 》這個外掛可以為您做些什麼, , 自動平台優化 (APO), 使用 Cloudflare 的自動平台優化 (APO) 外掛,可將您的 WordPress 網站加速達 300%。APO 讓 Cloudflare 可...。
  • The SEO Framework – Fast, Automated, Effortless. 》這是最快速且唯一符合 WordPress 和搜尋引擎規定的 SEO 外掛程式,功能完整。使用經過驗證的方式來優化您的網站的 SEO。這是一款乾淨、專注、可延伸、無限制...。
  • YARPP – Yet Another Related Posts Plugin 》WordPress 相關文章外掛, Yet Another Related Posts Plugin (YARPP) 是一個經過專業維護、高度自訂和功能豐富的外掛程式,可以顯示與當前文章相關的頁面、文...。
  • SEO Plugin by Squirrly SEO 》「Squirrly SEO 插件:#1 AI WordPress SEO 外掛程式」HTML描述, , Squirrly SEO 插件: AI WordPress SEO 插件, 解決您的 SEO 挑戰。, Squirrly 的使命是...。
  • SEO SIMPLE PACK 》“SEO SIMPLE PACK”是一款非常簡單的SEO外掛程式。, , 輸出基本的meta標籤,是SEO措施所必需的。, 可以對每個頁面類型進行設置。, 您也可以設置SN...。
  • Schema & Structured Data for WP & AMP 》d-data-for-wp.com/docs/article/how-many-schema-types-do-we-support/" rel="nofollow ugc">查看所有支援的類型,目前已支援超過35種類型,其中包括部落格...。

文章
Filter
Apply Filters
Mastodon