my blog add SEO

我的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

瘦仔,很傻很坚强
此条目发表在 coding, wordpress 分类目录,贴了 , , , 标签。将固定链接加入收藏夹。

my blog add SEO》有 2 条评论

  1. recole CHINA Internet Explorer Windows 说:

    在是百度搜索beeboo,已经排到第四了,貌似起作用了

发表评论

电子邮件地址不会被公开。 必填项已被标记为 *

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>