wordpress要求 php+mysql的支持,rewrite功能,比如apache的mod-rewrite或iis rewrite。
空間的速度,Google已經(jīng)明確把空間的速度列入網(wǎng)站排名要素之一,所以選擇一個快速穩(wěn)定的空間是seo的基礎(chǔ)。
并且快速穩(wěn)定的空間對 用戶體驗(yàn)也很好.
2.WordPress 主題的選擇
選擇一個優(yōu)秀的主題是seo的重要條件之一,有些主題本身就做了一定的seo優(yōu)化,所以選擇一款好的主題是 wordpress seo的基礎(chǔ)之一。
wordpress的主題推薦選擇代碼簡潔,div+css架構(gòu)的,圖片,js代碼越少越好,當(dāng)然并不是完全不能使用js代碼和圖片。
3.title 的優(yōu)化
wordpress的title優(yōu)化一般在主題的header.php文件中,title的寫法一般是首頁設(shè)置 為:關(guān)鍵詞-關(guān)鍵詞-關(guān)鍵詞-網(wǎng)站名稱。
內(nèi)容頁:標(biāo)題-網(wǎng)站名稱。
title的修改,如果是對php和wordpress主題函數(shù)比較熟悉 的,可以自己動手修改。
如果不懂的可以使用一些插件,比如all in seo插件,可以簡單的對title進(jìn)行rewrite,設(shè)置關(guān)鍵詞和描述。
4.keyword 和description
如果使用了all in seo插件,也可以直接設(shè)置,或者使用其他類似的插件。
需要注意的是,all in seo插件對百度的支持不大好,現(xiàn)在使用all in seo插件設(shè)置的描述百度無法抓取。
所以中文網(wǎng)站做百度優(yōu)化的千萬不要使用all in seo插件,用了也不能設(shè)置keyword和description。還有noindex選項(xiàng),千萬不能選擇,用了百度干死你。
小殘博客就是直接使用的在header.php頭部加入一下代碼
PHP Code復(fù)制內(nèi)容到剪貼板
- $description = "小殘博客(www.exehack.net)關(guān)注網(wǎng)絡(luò)安全、IT行業(yè)、網(wǎng)絡(luò)安全文章、網(wǎng)絡(luò)資源、電腦技術(shù)、網(wǎng)絡(luò)安全技術(shù)、網(wǎng)絡(luò)安全知識、互聯(lián)網(wǎng)安全知識、原創(chuàng)網(wǎng)絡(luò)安全博客";
- $keywords = "關(guān)注網(wǎng)絡(luò)安全,網(wǎng)站漏洞,網(wǎng)絡(luò)安全,網(wǎng)絡(luò)安全技術(shù),網(wǎng)絡(luò)安全知識,網(wǎng)絡(luò)安全教程,黑客新聞,服務(wù)器安全,網(wǎng)絡(luò)安全文章,系統(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. 固定鏈接
【網(wǎng)站聲明】本站除付費(fèi)源碼經(jīng)過測試外,其他素材未做測試,不保證完整性,網(wǎng)站上部分源碼僅限學(xué)習(xí)交流,請勿用于商業(yè)用途。如損害你的權(quán)益請聯(lián)系客服QQ:2655101040 給予處理,謝謝支持。