Yoast WordPress SEO Plugin 设置

Yoast SEO Plugin Settings

(挺好的一篇教程的,得空给他翻译成中文的)

The Yoast WordPress SEO Plugin by Joost De Valk is the most robust SEO plugin out there, but it must be setup and used properly if you want the best results for your SEO. This starts with configuring the different SEO tabs on the left of your dashboard once Yoast is installed.

Every website is different, so the best Yoast SEO plugin settings may be slightly different for each website. Just make sure you’ve updated Yoast before configuring the settings. I wrote separate tutorials on choosing focus keywords and optimizing content for green lightswhich are the next steps after configuring the settings – I would read those as well. I know there’s a lot to this tutorial so leave a comment if you have any questions. I’m here to help.

 

Upload My Yoast Settings To Your WordPress Site

If you want to use the same Yoast settings I use, download the zip file below. Upload it under SEO –> Tools –> Import And Export –> Import.

DOWNLOAD MY YOAST SETTINGS (ZIP FILE)

Things You Will Still Need To Do:

 

Table of Contents

1. Installation
2. General
3. Titles & Metas
4. Social
5. XML Sitemaps
6. Advanced
7. Tools
8. Webmaster Tools
9. Extensions


10. Choosing Focus Keywords
11. Optimizing Content For Green Lights
12. Social Media Optimization

 

1. Installation

Go to plugins –> add new –> search “WordPress SEO by Yoast” –> install/activate. You will now see the different Yoast tabs on the left side of your dashboard.

WordPress SEO by Yoast Installtion

 

2. General

Yoast General Settings Tab

Yoast Company Info

Logo should be at least 200×200 pixels – same with “image URL” in the Facebook social tab.

Yoast Webmaster Tools

Webmaster Tools

  • Sign up for Google Search Console (formerly Google Webmaster Tools)
  • During the verification process, select the “HTML tag” option
  • Copy the code
  • Paste code under SEO –> General –> Webmaster Tools –> Google Search Console
  • Delete everything outside of the quotations (including the quotations)
  • Save changes in Yoast
  • Click “Verify” in Google Search Console
  • Repeat for Bing and Yandex (Russia’s largest search engine), both of which have a similar verification process where you delete everything outside the quotations

Yoast Security Tab

Noindex – means you’re choosing not to index (publish) something in search engines

 

3. Titles & Metas

Yoast General Settings

Force Rewrite Titles
A common issue with Yoast is having duplicate sitenames in the SEO title. To see if this is happening to you, open your site and hover over the browser tab to check for duplicates:

Duplicate Title Tags

Selecting the Force Rewrite Titles under “Titles & Metas” should fix the duplicate sitename, but it’s not the preferred solution according to Yoast since it can slow down your site. The preferred solution is to go to Appearance –> Editor –> Header.php, then delete everything between <title> and </title. You’ll want to replace it with this code:

<title><?php wp_title(''); ?></title>

Doing this affects the title tag structure for all pages so it’s a good idea to double check how they appear after you change the settings (again, by hovering over the browser tab).

Yoast Homepage Settings

Yoast Post Types

If when editing your content you don’t write a custom SEO title and meta description (though you should since these are the forefront of your SEO which appear in search results), these will be your default templates. Here are other templates you can use:

Yoast Basic Variables

/******************************************

常用变量补充(点击旁边的?help 按钮就可以出来了):

Basic Variables

%%date%% Replaced with the date of the post/page
%%title%% Replaced with the title of the post/page
%%parent_title%% Replaced with the title of the parent page of the current page
%%sitename%% The site’s name
%%sitedesc%% The site’s tagline / description
%%excerpt%% Replaced with the post/page excerpt (or auto-generated if it does not exist)
%%excerpt_only%% Replaced with the post/page excerpt (without auto-generation)
%%tag%% Replaced with the current tag/tags
%%category%% Replaced with the post categories (comma separated)
%%category_description%% Replaced with the category description
%%tag_description%% Replaced with the tag description
%%term_description%% Replaced with the term description
%%term_title%% Replaced with the term name
%%searchphrase%% Replaced with the current search phrase
%%sep%% The separator defined in your theme’s wp_title() tag.

The following sample of variables require a better understanding of SEO. If you’re unsure about how to correctly use this, don’t. Or you can book a training at Yoast.

Advanced Variables

%%pt_single%% Replaced with the post type single label
%%pt_plural%% Replaced with the post type plural label
%%modified%% Replaced with the post/page modified time
%%id%% Replaced with the post/page ID
%%name%% Replaced with the post/page author’s ‘nicename’
%%userid%% Replaced with the post/page author’s userid
%%currenttime%% Replaced with the current time
%%currentdate%% Replaced with the current date
%%currentday%% Replaced with the current day
%%currentmonth%% Replaced with the current month
%%currentyear%% Replaced with the current year
%%page%% Replaced with the current page number (i.e. page 2 of 4)
%%pagetotal%% Replaced with the current page total
%%pagenumber%% Replaced with the current page number
%%caption%% Attachment caption
%%focuskw%% Replaced with the posts focus keyword
%%term404%% Replaced with the slug which caused the 404
%%cf_<custom-field-name>%% Replaced with a posts custom field value
%%ct_<custom-tax-name>%% Replaced with a posts custom taxonomies, comma separated.
%%ct_desc_<custom-tax-name>%% Replaced with a custom taxonomies description

******************************************/

 

 

Write Unique Meta Descriptions
If you’re using my default templates in the “Post Types” settings, your page title will now be used as the your SEO title, only your sitename will appear at the end. Same with your posts. These are good templates, and this means you can probably get away with not writing custom SEO titles anymore (unless you want them different from your page/post title).

But you should be writing unique meta descriptions for every page/post (the longer descriptions that appear in search results), otherwise an excerpt will be used which is a short description taken automatically from your content (not preferred). So even though your meta description has an OK template, I would always write unique meta descriptions.

Meta Robots – whether something is indexed in search engines (similar to noindex)

Date in Snippet Preview – selecting this will show each article’s publish date in search results (careful, this can make your content look outdated over time)

WordPress SEO Meta Box – selecting this will hide Yoast’s content optimization options (the meta box) when editing a page, post, category, etc

Yoast Taxonomies (2)

I keep my tags noindexed to prevent duplicate content penalties.

Yoast Archives

Yoast Other Tab

Noindex subpages of archives
If you have articles where a “next” button is used to get to /page2 then you probably want the first page to show up in search results (not the second), so this should be checked.

 

4. Social

Filling out Yoast’s social settings helps Google learn about your social profiles. They also help format your content so it displays properly in search engines AND when it’s shared on main social networks using Facebook Open GraphTwitter Cards, and Google+ meta data.

Yoast Social Settings

Yoast Facebook

Yoast Twitter

Yoast Pinterest

You will need to complete a few additional steps to verify your site with Pinterest.

Google+ Settings

 

5. XML Sitemaps

General Yoast XML Sitemap Settings

Submitting Your Yoast XML Sitemap To Google Search Console:

  • Go to SEO –> XML Sitemaps
  • Click the XML Sitemap button
  • Copy the last past of the URL, which should be: /sitemap_index.xml
  • Login to Google Search Console
  • On the left, go to Crawl –> Sitemap
  • Paste the last part of the URL (screenshot below)
  • Test and submit
  • Repeat for Bing and Yandex

Yoast Sitemap

Yoast User Sitemap

Yoast Post Types Sitemap Settings

Yoast Taxonomies Sitemap

 

6. Advanced

Yoast Breadcrumb Settings

Breadcrumbs are the navigation text that appears at the top of your content:

Breadcrumbs

It helps users and search engines learn your content and site structure. I don’t use breadcrumbs to prevent clutter, but I recommend them if you don’t mind the extra text.

To enable breadcrumbs, add this code to Editor –> Index.php. Paste under get_header();

get_header(); ?>
<div id="primary"> 
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>
<div id="content" role="main">

Yoast Permalink Settings

Strip The Category Base From The Category URL
If your permalink structure has the word “category” in it (not preferred), this will remove it. Removing this from your permalink structure will cause your URLs to change though, so setting up a 301 redirect for each URL this affects would be a wise decision.

Redirect Attachment URL’s To Parent Post URLs
When you upload an image, PDF, or any file to WordPress, that file is stored in your media section and also becomes searchable. Selecting this will redirect visitors who find that file URL to the parent post URL (the URL it was uploaded to).

Remove Stop Words From Slugs
Stop words are words like (the, a, and, how) and other words that aren’t descriptive and can cause long, not keyword-rich permalinks. Selecting this will remove stop words from your permalink. It won’t automatically change permalinks already published posts, only when you hit “save” or “publish.” I prefer to control my permalinks, so I leave this unchecked.

Remove The ?replytcom
This removes these types of URLs: http://yoast.com/user-contact-fields-wordpress/#comment-110294 which is good since it prevents duplicate content and improves search engine crawling efficiency. This Moz thread does a good job of explaining it.

Enforce A Trailing Slash On All Category And Tag URLs
If you have .html at the end of your URLs, this option will remove it – which is a good thing.

Redirect Ugly URL’s To Clean Permalinks
If people use an incorrect letter or parameter when they’re linking to you, this option attempts to redirect that link to the correct URL. This is not recommended since it clearly states in the Yoast SEO settings that this option can cause problems.

Yoast RSS Settings

In your feed, here’s what will appear before each post…

%%BLOGLINK%%
%%BLOGDESCLINK%%

And here’s what will appear after each post…

%%POSTLINK%%
%%AUTHORLINK%%

 

7. Tools

Yoast Tools Tab

Bulk Editor
Your SEO titles and meta descriptions are the forefront of your SEO (they’re the descriptions that appear in search results), so going through these and making sure they’re well-written is good idea. This will improve your clickthrough and potentially your traffic.

Editing meta descriptions can be super helpful since these are summaries of your content and can usually be tweaked to sound better (while including your focus keyword of course):

Bulk Meta Description Editor

File Editor
Allows you to edit robots.txt and .htaccess files.

Import And Export
Use the import button to upload my recommended Yoast settings (zip file) to your website. If you manage multiple sites, you can export your own settings and upload them to those sites.

Yoast Import SEO Plugin

 

8. Search Console

Yoast recently added a Search Console option to their settings. This allows you to access (some) information from Google Search Console (formerly Google Webmaster Tools) directly into Yoast. Start by clicking “Get Google Authorization Code” to authenticate…

Yoast Google Search Console Authentication

Here you will find different types of errors (page not found, server errors, soft 404s…). You can fix these by setting up 301 redirects which come with Yoast’s premium version, however you can use a free plugin like Quick Page/Post Redirect to do this quite easily.

Yoast Google Search Console

To setup a 301 redirect using Quick Page/Post Redirect, install the plugin then go to Quick Redirects –> Quick Redirects. The old URL should be the one you see in Yoast, the new URL should be whatever URL you want you want it redirected to. See the example…

301 Redirect WordPress

 

9. Extensions

Yoast Plugins

The Yoast extensions are premium (paid) plugins for specific SEO needs…

 

10. Choosing Focus Keywords

Google Autocomplete Keywords

SEE MY ARTICLE ON YOAST FOCUS KEYWORDS

 

11. Optimizing Content For Green Lights

Yoast Page Analysis

SEE MY ARTICLE ON YOAST GREEN LIGHTS

 

12. Social Media Optimization

When editing a page/post, you’ll see a “social” tab in Yoast (see below). By uploading an image for Facebook/Twitter/Google+ with the correct dimensions for each social network (see dimensions below), that page/post will show an image that is formatted correctly to be shared across those networks. Yes, this means you must create a new graphic for each one.

  • Facebook Image: 1200 x 628px
  • Twitter Image: 1024 x 512px
  • Google+ Image: 800 x 1200px

You can also give the post a unique title/description when it’s shared, otherwise the SEO title and meta description will be used, which is OK with me so I always leave those blank.

Yoast Social Media Optimization

 

Questions? Comments? Drop Me A Line!

I know there’s a lot to configuring the Yoast SEO plugin settings so leave me a comment if you have any questions. When you’re done, check out my other Yoast tutorials on choosing focus keywords and optimizing content for green lights. They are both just as thorough.

Before you say goodbye, if you liked my article, please consider sharing it on your favorite social network. The social share buttons make it easy and I would really appreciate it.

via: http://onlinemediamasters.com/

网站开启SSL(HTTPS)后 百度SEO的完美解决方案

远方的海开启SSL后经过不少的折腾终于找到了完美解决百度对SSL站点不友好的问题了。还是谷歌好,直接就收录SSL站点,而且真正的提高了https网站的权重。来看看Sven研究出来的方案吧!

问题所在

问题一,百度蜘蛛不给力,经常抓取超时

为什么说百度对SSL不友好,经过百度站长中心的抓取诊断测试,我发现了百度虽然通过这个模拟测试可以抓取到网页,但是显示跳转而且时间颇长。

没有加HTTPS的网页(按照远方的海为例),抓取时间在0.2秒左右;而加上了HTTPS跳转,百度的抓取时间则快在三秒,慢则十几秒。这个十几秒是什么概念?如此慢的抓取速度,在网络高峰期再慢点就可以导致抓取超时了!

来看看网站异常数据统计,开启了SSL后百度的蜘蛛一直显示我的网站抓取超时,其出错率已经超过10%,我们来看图片里面潮起潮落的绿色线条,它表示着抓取超时次数:

百度蜘蛛抓取超时

问题二,sitemap文件不能抓取

远方的海已经获取了百度的sitemap提交权限,我打开百度的sitemap提交更新了一下sitemap,发现了如下所示:

SSL站点百度站长中心抓取sitemap错误

我们来看看这些问题:

  • 呵呵哒了,网站居然华丽丽的不能抓取sitemap.xml文件。
  • 既然不能抓取sitemap.xml文件,那好吧,百度出了一款baidu submit的插件,这款插件的效果如何呢?Sven也郑重的告诉大家,这款插件提交的网址也是https的,所以百度一样不能抓取。
  • 最近很火的代码版提交网页,按照上面的节奏估计多半也是不可以正常抓取的。

百度SEO解决方案

让我们一起来看看解决方案吧!

第一步,首先在WordPress设置 – 常规设置 中把WordPress的两个网址全部改回http开的。

第二步,修改.htaccess文件来重定向到https网站。代码如下:

RewriteEngine On
RewriteCond %{HTTPS} !on [NC]
RewriteCond %{HTTP_USER_AGENT} (chrome|googlebot|safari|opera|firefox) [NC]
RewriteRule ^(.*)$ http://www.seavia.com/$1 [R=301,L]

这里已经包括了很多浏览器和谷歌爬虫的UA了,把这些UA定向到https页面,其余的基本可以让它去抓http的网页。

或者给出类似于V2EX这种网站的解决方法,V2EX据我分析是百度的spider定向到http上,谷歌的spider定向到https上,其余的不作处理,以下是Apache主机的.htaccess重定向写法:

RewriteEngine On
RewriteCond %{HTTPS} !on [NC]
RewriteCond %{HTTP_USER_AGENT} (googlebot) [NC]
RewriteRule ^(.*)$ http://www.seavia.com/$1 [R=301,L]
RewriteCond %{HTTPS} on [NC]
RewriteCond %{HTTP_USER_AGENT} (baiduspider) [NC]
RewriteRule ^(.*)$ http://www.seavia.com/$1 [R=301,L]

第三步,把主题里面的http://www.seavia.com类似的网址全部换成http://www.seavia.com,这样就可以自动识别http和https了。

设置完之后,我们来看看现在的情况:

  • 用chrome等浏览器打开网站,依然显示小绿锁;
  • 百度抓取也成功缩短到0.2s,sitemap也可以成功提交了。

百度sitemap成功提交

于是,度娘对SSL不友好的问题就这么解决了,也不指望百度那边的SSL给我的网站加多少权重,只希望不影响我网站的排名。

via:  www.wpdaxue.com

WordPress非插件实现向百度提交链接

百度官方给WordPress专门出过一个插件,叫做baidu sitemap,用过的人都知道这个插件在发布文章的时候,需要奇卡无比的5秒左右的时间来反应。今天正好看见了这个插件的代码版本,在这里分享给大家。

Baidu submit代码版

新建一个名叫baidusubmit.php的文件,把以下代码放入这个文件中,注意,代码里面的WEB_TOKEN值每个网站都不一样,前往百度站长中心 查看自己网站的值。

//百度推送
if(!function_exists('Baidu_Submit')){
 function Baidu_Submit($post_ID) {
 $WEB_TOKEN = '这里是你自己的值,形如ucyMy5jfslZjvLSn'; //这里要换成你自己的token值
 $WEB_DOMAIN = get_option('home');
 //已成功推送的文章不再推送
 if(get_post_meta($post_ID,'Baidusubmit',true) == 1) return;
 $url = get_permalink($post_ID);
 $api = 'http://data.zz.baidu.com/urls?site='.$WEB_DOMAIN.'&token='.$WEB_TOKEN;
 $request = new WP_Http;
 $result = $request->request( $api , array( 'method' => 'POST', 'body' => $url , 'headers' => 'Content-Type: text/plain') );
 $result = json_decode($result['body'],true);
 //如果推送成功则在文章新增自定义栏目Baidusubmit,值为1
 if (array_key_exists('success',$result)) {
 add_post_meta($post_ID, 'Baidusubmit', 1, true);
 }
 }
 add_action('publish_post', 'Baidu_Submit', 0);
}

把刚才制作好的baidusubmit.php放在主题的文件夹中,并在functions.php中添加以下代码:

//Baidu submit
if( is_admin() ) :
 require( dirname(__FILE__) . '/baidusubmit.php' );
endif;

这样就可以只在后台发布文章时才调用这串代码了。

代码效果测试

在更新或发布新文章时,代码会提交给百度你的文章链接,成功的时候会在文章新增自定义栏目Baidusubmit,值为1。如下所示:

baidusubmit

如果你找不到自定义栏目,在文章编辑器的右上角,点击显示选项就能开启。这个百度提交还是很不错的,大家都可以试试!

via: www.seavia.com