我的blog是wordpress的源程序,SEO设计的不太好,在google上搜了’beeboo’,查出的都是一个北体的MM,打击,搜’beeboo’s blog’妈的更受打击!所以决定对我的blog做初步的seo!
1.把 <title>里的内容替换成
<?php $the_title = wp_title(‘ – ‘, false); if ($the_title != ”) : ?>
<title><?php echo wp_title(”,false); ?> – <?php bloginfo(‘title’); ?></title>
<?php else : ?>
<title><?php bloginfo(‘name’); ?> – <?php bloginfo(‘description’); ?></title>
<?php endif; ?>
2.在 <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/css” media=”screen” /> 这一行下添加
<?php if (is_home()){
$description = “beeboo,beeboo的博客”;
$keywords = “beeboo,beeboo的博客,beeboo个人博客”.bloginfo(‘description’);
} elseif (is_single()){
if ($post->post_excerpt) {
$description = $post->post_excerpt;
} else {
$description = substr(strip_tags($post->post_content),0,220);
}
$keywords = “beeboo,”;
$tags = wp_get_post_tags($post->ID);
foreach ($tags as $tag ) {
$keywords = $keywords . $tag->name . “,”;
}
}
?>
<meta name=”keywords” content=”<?php echo $keywords; ?>” />
<meta name=”description” content=”<?php echo $description; ?>” />
3.添加 robots.tet,同时屏蔽点一些不该要搜索引擎搜索到的文件夹
User-agent: *
Disallow: /wp-
Disallow: /feed/
Disallow: /comments/feed
Disallow: /trackback/
Allow: /
这样就把 title 和 关键字 和description实习了初步的SEO优化。当然,如果想排在谷歌,百度的第一页还得需要很长的时间和路要走,不过有优化总比没有好
在
在
在是百度搜索beeboo,已经排到第四了,貌似起作用了
以前在上一个公司做过seo优化,所以有点点经验,但不精通,