NHANWEB

Tối ưu hóa thẻ meta Description trong theme WordPress

Không nhỡ rõ mình đã đọc ở đâu một câu rất hay, meta Keyword không quan trọng bằng meta Description và meta Title trong việc SEO. Tuy nhiên, với hầu hết các theme của WordPress, thẻ meta Description (Desc) không được hiển thị tại vị trị tốt nhất. Và ngay cả khi mọi người sử dụng Plugin All in one Seo, vị trí của thẻ Desc vẫn không được cải thiện là bao.

Tối ưu hóa thẻ meta description

Chúng ta cùng thử phân tích 1 ví dụ nhé:

Code của Nhanweb.com

[code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Nguyen Duy Nhan – Blog học tập, chia sẻ kiến thức lập trình và quản trị website, kiếm tiền qua mạng</title>
<meta name="description" content="Blog học tập, chia sẻ kiến thức lập trình và quản trị website, kiếm tiền qua mạng" />
[/code]

Thẻ Title và thẻ Description được đẩy lên đầu nhằm giúp các Bot tìm kiếm dễ dàng đọc và nhanh chóng index site cũng như các bài viết mới.

Code của as247.vui360.com/blog/ (Không phải site mình nhá)

[code] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="keywords" content="" /><meta name="description" content="" /><title>.:As*** – As247:.</title><link rel="alternate" type="application/rss+xml" title="RSS 2.0 – all posts" href="http://as247.vui360.com/blog/feed/" /><link rel="alternate" type="application/rss+xml" title="RSS 2.0 – all comments" href="http://as247.vui360.com/blog/comments/feed/" /><link rel="pingback" href="http://as247.vui360.com/blog/xmlrpc.php" /><!– style START –><link rel="stylesheet" href=" http://as247.vui360.com/blog/wp-content/themes/as247/style.css" type="text/css" media="screen" /><!–[if IE 6]><link rel="stylesheet" href="http://as247.vui360.com/blog/wp-content/themes/as247/ie6.css" type="text/css" media="screen" /><![endif]–><!– style END –><!– script START –><script type="text/javascript" src="http://as247.vui360.com/blog/wp-content/themes/as247/js/menu.js"></script><script type="text/javascript" src="http://as247.vui360.com/blog/wp-content/themes/as247/js/util.js"></script><!– script END –><link rel=’stylesheet’ id=’NextGEN-css’ href=’http://as247.vui360.com/blog/wp-content/plugins/nextgen-gallery/css/nggallery.css?ver=1.0.0′ type=’text/css’ media=’screen’ />
<link rel=’stylesheet’ id=’shutter-css’ href=’http://as247.vui360.com/blog/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.css?ver=1.3.2′ type=’text/css’ media=’screen’ />
<link rel=’stylesheet’ id=’sociable-front-css-css’ href=’http://as247.vui360.com/blog/wp-content/plugins/sociable/sociable.css?ver=3.1.3′ type=’text/css’ media=’all’ />
<link rel=’stylesheet’ id=’wp-downloadmanager-css’ href=’http://as247.vui360.com/blog/wp-content/plugins/wp-downloadmanager/download-css.css?ver=1.50′ type=’text/css’ media=’all’ />
<link rel=’stylesheet’ id=’wp-pagenavi-css’ href=’http://as247.vui360.com/blog/wp-content/themes/as247/pagenavi-css.css?ver=2.70′ type=’text/css’ media=’all’ />
<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-includes/js/l10n.js?ver=20101110′></script>
<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-includes/js/jquery/jquery.js?ver=1.4.4′></script>
<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-content/plugins/collapsing-links/collapsFunctions.js?ver=1.7′></script>
<script type=’text/javascript’>
/* <![CDATA[ */
var shutterSettings = {
msgLoading: "L O A D I N G",
msgClose: "Click to Close",
imageCount: "1"
};
/* ]]> */
</script>
<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-content/plugins/nextgen-gallery/shutter/shutter-reloaded.js?ver=1.3.2′></script>

<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-includes/js/swfobject.js?ver=2.2′></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://as247.vui360.com/blog/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://as247.vui360.com/blog/wp-includes/wlwmanifest.xml" />
<link rel=’index’ title=’.:As*** – As247:.’ href=’http://as247.vui360.com/blog/’ />
<meta name="generator" content="WordPress 3.1.3" />
<script type=’text/javascript’ src=’http://as247.vui360.com/blog/wp-includes/js/tw-sack.js?ver=1.6.1′></script>
<script type="text/javascript">
// ajax_login_widget settings
var alw_timeout = 0;
var alw_redirectOnLogin = ”;

// constants
var alw_base_uri = ‘http://as247.vui360.com/blog’;
var alw_success = ‘1’;
var alw_failure = ‘0’;

</script>
<script type="text/javascript" src="http://as247.vui360.com/blog/wp-content/plugins/ajax-login-widget/ajax_login_widget.js"></script>

<!– All in One SEO Pack 1.6.13.3 by Michael Torbert of Semper Fi Web Design[321,360] –>
<meta name="Description" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">

<meta name="keywords" content="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />

<link rel="canonical" href="http://as247.vui360.com/blog/" />

<!– /all in one seo pack –>
[/code]

Blog này sử dụng plugin như hầu hết chúng ta vẫn dùng, tuy nhiên, thẻ Desc lại nằm tại vị trí quá tệ.

Vậy sử dụng cách nào để giải quyết? Mình sẽ giới thiệu 1 cách để các bạn có thể khắc phục nhược điểm trên. Đó là tạo Meta Desc thông qua excerpt trong bài viết

Bạn chèn vào vị trí bạn muốn đặt thẻ Desc trong header.php như sau:
[php] <?php
if (is_singular()):
global $post;
setup_postdata($post);
?>
<meta name=”description” content=”<?php the_excerpt_rss(); ?>” />
<?php endif; ?>
[/php]

Lúc này, content=”<?php the_excerpt_rss(); ?>” sẽ truy vấn giá trị bạn nhập trong ô excerpt trong bài viết để làm Description.

Bạn có thể tích hợp thêm 1 số tính năng đơn giản như tự động cắt tại 160 kí tự nhằm tăng thêm tính hiệu quả cho thẻ.

Exit mobile version