
內容簡介
這個外掛程式提供了一個快速簡單的介面,讓您可以輕鬆為頁面或文章添加 SEO meta 資料。設計的初衷是移除您不需要的所有額外東西。這個外掛程式非常簡單,沒有任何混淆的額外選項或討人厭的廣告,所以您可以輕鬆地使用它並放心地給客戶。
可自行選擇要添加到哪些文章類型中(預設為公開的文章類型)
能良好地整合到 Sewn In XML Sitemap 外掛程式中,因此它們會合併為一個面板,方便您編輯。
使用 Sewn In Simple Social Optimization 外掛程式能完全控制 Facebook 和 Twitter 的社交分享設定。
非常簡單,沒有任何您不需要的雜物或額外功能。
控制要添加的文章類型
預設僅會添加頁面和文章,但您可以使用以下篩選器刪除它們中的其中一個或兩個,或是添加更多文章類型:
/**
* 完全替換 XML sitemap 和 SEO 編輯功能中的文章類型
*
* 這會完全替換預設值。返回值:array('news','event')
*
* 這會刪除 'post' 和 'page' 文章類型,並添加 'news' 和 'event' 文章類型
*
* @param array $post_types 要添加到 XML Sitemap 的文章類型清單
* @return array $post_types 修改過後的文章類型清單
*/
add_filter( 'sewn/seo/post_types', 'custom_sitemap_post_types' );
function custom_sitemap_post_types( $post_types ) {
$post_types = array('news','event');
return $post_types;
}
添加關鍵字
要節制使用關鍵字,如果使用不當的話,meta 關鍵字會造成更多的傷害。不要過度使用。因此,我們預設已關閉此功能。如果您需要關鍵字,您可以在 functions.php 中開啟它們:
add_filter( 'sewn/seo/add_keywords', '__return_true' );
啟用自動產生描述
我們不建議這樣做。meta 描述應當用作製作搜尋引擎顯示內容的方式,否則只能讓搜尋引擎自行產生內容。這對可見度沒有一個有效的影響,甚至可能會阻礙搜尋引擎深入查找頁面中的其他內容。糟糕的描述可能會造成損害,並且很可能沒有任何好處。
add_filter( 'sewn/seo/default_description', '__return_true' );
其他篩選器
/**
* 自訂首頁或部落格頁面標題
*/
add_filter( 'sewn/seo/home_title', 'custom_seo_home_title' );
function custom_seo_home_title( $title ) {
return '我的部落格頁面標題';
}
/**
* 自訂 404 標題
*/
add_filter( 'sewn/seo/404_title', 'custom_seo_404_title' );
function custom_seo_404_title( $title ) {
return '您搜尋的頁面不存在';
}
/**
* 自訂存檔標題
*/
add_filter( 'sewn/seo/archive_title', 'custom_seo_archive_title' );
function custom_seo_archive_title( $title ) {
// 自訂標題
}
/**
* 自訂存檔描述
*/
add_filter( 'sewn/seo/archive_description', 'custom_seo_archive_description' );
function custom_seo_archive_description( $description ) {
// 自訂描述在此
}
相容性
能與Sewn In XML Sitemap 外掛程式和
外掛標籤
開發者團隊
原文外掛簡介
Adds a fast, simple interface for adding SEO meta data to pages and posts. Designed to remove all of the extra stuff that you just won’t use. It is made to be straight forward for users with no confusing extras and no annoying ads. So you can enjoy using it and feel comfortable putting it before a client.
Choose which post types it is added to (public post types by default)
Integrates nicely with the Sewn In XML Sitemap plugin, so they get merged into one panel for editing.
Use the Sewn In Simple Social Optimization plugin to add full control over social sharing settings for Facebook and Twitter.
Very simple, no cruft or extra features you won’t use.
Control what post types are added
By default only pages and posts are added, but you can remove either of those and/or add more using this filter:
/**
* Completely replace the post types in the XML sitemap and SEO edit functionality
*
* 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_sitemap_post_types' );
function custom_sitemap_post_types( $post_types ) {
$post_types = array('news','event');
return $post_types;
}
Add Keywords
Use sparingly. Meta keywords can do more harm than help when used incorrectly. Don’t overload them. For that reason, we turned it off by default. If you want them, you can turn them back on by adding this to your functions.php.
add_filter( 'sewn/seo/add_keywords', '__return_true' );
Turn on Auto-Generated Descriptions
We don’t recommend this. The meta description should be used as a way to craft what the search engines show, otherwise, let the search engines auto generate the descriptions. It doesn’t really have a significant impact on visibility and may hinder visibility by keeping the search engine from digging as deep into the rest of the page. Bad descriptions may do harm, and likely don’t do any good.
add_filter( 'sewn/seo/default_description', '__return_true' );
Other filters
/**
* Custom home or blog page title
*/
add_filter( 'sewn/seo/home_title', 'custom_seo_home_title' );
function custom_seo_home_title( $title ) {
return 'My blog page title';
}
/**
* Customize 404 titles
*/
add_filter( 'sewn/seo/404_title', 'custom_seo_404_title' );
function custom_seo_404_title( $title ) {
return 'These are not the pages you are looking for';
}
/**
* Customize archive titles
*/
add_filter( 'sewn/seo/archive_title', 'custom_seo_archive_title' );
function custom_seo_archive_title( $title ) {
// Customize the title
}
/**
* Custom archive descriptions
*/
add_filter( 'sewn/seo/archive_description', 'custom_seo_archive_description' );
function custom_seo_archive_description( $description ) {
// Custom description here
}
Compatibility
Works with the Sewn In XML Sitemap plugin and the Sewn In Simple Social Optimization plugin. When installed, the XML sitemap checkbox integrates with the SEO fields. The goal is to keep things very simple and integrated.
