1.空間的選擇
wordpress要求 php+mysql的支持,,rewrite功能,,比如apache的mod-rewrite或iis rewrite,。
空間的速度,,Google已經(jīng)明確把空間的速度列入網(wǎng)站排名要素之一,,所以選擇一個快速穩(wěn)定的空間是seo的基礎,。
并且快速穩(wěn)定的空間對 用戶體驗也很好.
2.WordPress 主題的選擇
選擇一個優(yōu)秀的主題是seo的重要條件之一,,有些主題本身就做了一定的seo優(yōu)化,,所以選擇一款好的主題是 wordpress seo的基礎之一,。
wordpress的主題推薦選擇代碼簡潔,div+css架構的,,圖片,,js代碼越少越好,當然并不是完全不能使用js代碼和圖片,。
3.title 的優(yōu)化
wordpress的title優(yōu)化一般在主題的header.php文件中,,title的寫法一般是首頁設置 為:關鍵詞-關鍵詞-關鍵詞-網(wǎng)站名稱。
內(nèi)容頁:標題-網(wǎng)站名稱,。
title的修改,,如果是對php和wordpress主題函數(shù)比較熟悉 的,可以自己動手修改,。
如果不懂的可以使用一些插件,,比如all in seo插件,可以簡單的對title進行rewrite,,設置關鍵詞和描述,。
4.keyword 和description
如果使用了all in seo插件,也可以直接設置,,或者使用其他類似的插件,。
需要注意的是,all in seo插件對百度的支持不大好,,現(xiàn)在使用all in seo插件設置的描述百度無法抓取,。
所以中文網(wǎng)站做百度優(yōu)化的千萬不要使用all in seo插件,用了也不能設置keyword和description,。還有noindex選項,,千萬不能選擇,用了百度干死你,。
小殘博客就是直接使用的在header.php頭部加入一下代碼
$description = "小殘博客(www.exehack.net)關注網(wǎng)絡安全,、IT行業(yè)、網(wǎng)絡安全文章,、網(wǎng)絡資源,、電腦技術、網(wǎng)絡安全技術,、網(wǎng)絡安全知識,、互聯(lián)網(wǎng)安全知識、原創(chuàng)網(wǎng)絡安全博客"; $keywords = "關注網(wǎng)絡安全,網(wǎng)站漏洞,網(wǎng)絡安全,網(wǎng)絡安全技術,網(wǎng)絡安全知識,網(wǎng)絡安全教程,黑客新聞,服務器安全,網(wǎng)絡安全文章,系統(tǒng)安全";} elseif (is_single() || is_page()) { $description1 = get_post_meta($post->ID, "description", true); $description2 = mb_strimwidth(strip_tags(apply_filters ('the_content', $post->post_content)), 0, 200, "…"); $description = $description1 ? $description1 : $description2; $keywords = get_post_meta($post->ID, "keywords", true); if($keywords == '') { $tags = wp_get_post_tags($post->ID); foreach ($tags as $tag ) { $keywords = $keywords . $tag->name . ", ";} $keywords = rtrim($keywords, ', ');} } elseif (is_category()) { $description = category_description(); $keywords = single_cat_title('', false);} elseif (is_tag()){ $description = tag_description(); $keywords = single_tag_title('', false); } $description = trim(strip_tags($description)); $keywords = trim(strip_tags($keywords)); ?> <meta name="description" content="<?php echo $description; ?>" /> <meta name="keywords" content="<?php echo $keywords; ?>" />
5. 固定鏈接
wordpress的默認固定鏈接是www.exehack.net/?p=32的形式,,是動態(tài)鏈接對搜索引擎不 太友好,,所以需要修改。
直接通過設置-固定鏈接選項,,可以方便的修改固定鏈接的形式,。至于選擇哪種鏈接形式,,其實主要看個人喜好。
推薦選擇 /%postname%/形式,。需要注意的是,,固定鏈接要在網(wǎng)站建立之初就確立好,以后切勿修改,,更改固定鏈接會對網(wǎng)站權重造成很大影響,,即使使用301 重定向也是一樣的,所以不要修改固定鏈接,。
6.robots.txt
robots.txt 文件放在根目錄下面,,是給搜索引擎設置的爬行規(guī)則,可以規(guī)定搜索引擎可以爬行那些頁面,。
wordpress的robots.txt寫法,,可以搜索一下,并 沒有標準答案,,主要是注意禁止搜索引擎抓取后臺文件即可。
可以參考本站的寫法http://www.exehack.net/robots.txt
7.sitemap.xml
sitemap 是一個xml格式的網(wǎng)站地圖文件,,通過提交到搜索引擎,,可以使搜索引擎更加容易抓取你的網(wǎng)站,sitemap是Google率先推出的,,最近百度也支持 sitemap的提交,,不過Google和百度的sitemap文件格式是有一些區(qū)別的。
wordpress的sitemap文件生成,,直接使用插件即 可,。wordpress的插件安裝,在后臺點擊添加插件,,然后直接搜索安裝即可,。
Google的sitemap插件名是Google XML Sitemaps,百度是Baidu Sitemap Generator,。
8.內(nèi)部鏈接
可以使用wordpress related post插件,,它可以根據(jù)文章關鍵詞生成一個相關文章列表,對于網(wǎng)站內(nèi)部鏈接和用戶體驗都是有好處的,。