Home > Web Related > Optimize WordPress title style without All in One SEO

Optimize WordPress title style without All in One SEO

December 25th, 2009 Manana Leave a comment Go to comments

Most guys see All in One SEO Pack which is ranked first in the downloaded ranking. Well, No.1 is a lot more attractive of course, but popSOHO didn’t follow that. Carefully studying the plug-in, we can find the following functions of it as below:

  1. Add independent descriptions and keywords manually.
  2. Generating article excerpts automatically.
  3. Avoid repeated crawling by search engines.

All of functions above can easily achieved by small changing of WP codes, which in addition reduces the negative effect of using a plugin. Some WP versions did that for users, and some other templates like inove didn’t. We today show the steps of that kind of optimizing.

  • Title optimizing

Find the codes as following, usually in your header.php file:

<title><?php bloginfo(‘name’); ?><?php wp_title(); ?></title>

or codes are similar to them with the tag <title> and</title>. Then replace the codes by following:

<?php if (is_home () ) { echo $description; echo ” – “;bloginfo(‘name’); } elseif ( is_category() ) { single_cat_title();echo ” – “; bloginfo(‘name’); } elseif (is_single() || is_page() ) { single_post_title(); echo ” – “; bloginfo(‘name’); }elseif (is_search() ) { bloginfo(‘name’); echo “search results:”; echo wp_specialchars($s); } else { wp_title(”,true); } ?>

Now you get the same title style as popSOHO.om.

  • Meta optimizing

Of course, you should also define the meta as following:

<?php
if (is_home() || is_page())
{
$description = “Top Keys to Online Earning and Best Tips for Online Shopping”;
$keywords = “popsoho, make money online, SEO”;
}// replace by your own description and keyword of course.
elseif (is_single())
{
$desc = “description”;
$key = “keywords”;
$description = get_post_meta($post->ID, $desc, true);
$keywords = get_post_meta($post->ID, $key, true);
}
elseif (is_category())
{
$text = category_description();
$description = strip_tags($text);
}
$description = str_replace(array(“\r\n”,”\r”,”\n”,”&nbsp;”),”",$description);
$keywords = str_replace(array(“\r\n”,”\r”,”\n”),”",$keywords);
?>
<meta name=”description” content=”<?php echo $description; ?>” />
<?php if ( !is_category() ) { ?>
<meta name=”keywords” content=”<?php echo $keywords; ?>” />
<?php } ?>
<?php if ( is_category() ) { ?>
<meta name=”keywords” content=”<?php wp_title(‘ ‘); ?>” />
<?php } ?>

Add codes above between the php tags <head> and </head>, and you’d better let the codes before the <title> tag mentioned above when optimizing the title.

Now you can define your own description and keyword metadata in the Custom Fields. After all that steps, you can add description and keyword respectively for each article before your posting.

  • Avoid repeated crawling by search engines

Merry Christmas and enjoy your work!

Categories: Web Related Tags: ,
  1. January 12th, 2010 at 13:32 | #1

    Nice. I’ll use that at my web-page
    valorolo dot ru – cool java games! Отличные ява игры!

  2. February 4th, 2010 at 11:04 | #2

    Great idea, but will this work over the long run?

  3. Manana
    February 5th, 2010 at 20:08 | #3

    No problem.

  4. February 14th, 2010 at 22:39 | #4

    Good brief and this mail helped me alot in my college assignement. Gratefulness you for your information.

  5. February 16th, 2010 at 05:00 | #5

    http://www.popsoho.com; You saved my day again.

  6. March 10th, 2010 at 08:18 | #6

    Hey it

  7. March 10th, 2010 at 21:08 | #7

    I really like your writing style, its not generic and extremly long and tedious like a lot of blog posts I read, you get to the point and I really enjoy reading your articles! Oh, and merry Christmas!

  8. March 11th, 2010 at 20:49 | #8

    Please, can you PM me and tell me few more thinks about this, I am really fan of your blog…gets solved properly asap.

  9. March 12th, 2010 at 21:46 | #9

    Thought I would spend time to read and comment on most of your articles today as the weather is so shocking :(

  10. March 14th, 2010 at 19:21 | #10

    To start earning money with your blog, initially use Google Adsense but gradually as your traffic increases, keep adding more and more money making programs to your site.

  1. No trackbacks yet.

Spam Protection by WP-SpamFree