WordPress Concise SEO title, keywords and description

Source: Internet
Author: User

WordPress title, Keywords and description, the reason is concise, it is to stand in the perspective of SEO to consider.

First of all, now the keyword this tag has been thrown into the history of the search engine garbage heap, so this keywords tag has been useless, do not write.

Second, the role of the description is already very small, in addition to the first page, category pages, tabs, the best custom description, the article page description is not written, the search engine will automatically invoke the content of the article to show the search results page description. That is to say, description This tag appears on the homepage, the category page and the tab page of these important aggregation pages.

OK, look at the concise WordPress title, Keywords and description is how to write

<title><?phpif (Is_home () &&!is_paged ()) {$title =get_bloginfo ("name"). "-". Get_bloginfo ("description");} else{$title =wp_title ("-", True, "right"); Bloginfo ("description");} if ($paged <2) {echo $title;} Else{echo "$title & #8211; Page $paged ";}?></title><?php if (is_home ()) {?><Metaname= "description"content= "This is the description of the homepage" /><?php} elseif (is_category () | | Is_tag ()) {?>  <Metaname= "description"content= "<?php echo strip_tags (Category_description ());? > " /><?php}?>

Just insert this code into the appropriate location in header.php.

The title effect of this code implementation is:

Home: Blog Name – Blog description

Page page: Blog name-2nd page

Other Pages: page name – Blog description

Other Pages: page name – Blog name-2nd page

The effect of the description is:

Customize the Home page description, which is modified in this code

Customize the description of the category and tab pages, which are modified in the background image description

Other pages do not show a description

WordPress Concise SEO title, keywords and description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.