Nova Scotia Flag

SCOTIA SYSTEMS BLOG




WordPress – No-Index Duplicate Content

April 17th, 2010 admin

As a follow-up post on duplicate content on WordPress blogs – here’s an additional tip.

You can stop the search engines from indexing duplicate pages such as monthly/daily archives by using the following code snippet:

if(is_home() || is_single() || is_page() || is_category() || is_tag())
{
       echo ‘<meta name=”robots” content=”index,follow” />’;
}
else
{
        echo ‘<meta name=”robots” content=”noindex,follow” />’;
}

You can add or remove arguments in line 1 to include or exclude pages form being indexed.

The code should be inserted into the <head> section of header.php.





WordPress – Adding Page Numbers to Meta Tags

April 17th, 2010 admin

Here’s a quick tip for WordPress users.   Identical title tags on pages are frowned upon by search engines, so ideally you want each title tag (and meta description) to be unique. 

With WordPress you’ll find that your second page, third page etc all have the same title.   You can fix this with the following PHP code:

 

<?php if ($paged < 2){} else {echo (‘ Page ‘); echo ($paged);} ?>

 

By inserting the above into the title tag – if the page is the page 1, nothing will happen but for any other pages it will append “Page #".

You can use similar code in the Meta Description too to help make it unique.