WP e-Commerce SEO Tutorial

SEO Tutorial Overview

  1. Some SEO basics.
  2. Remove Wordpress headline from “products-page”.
  3. Add h1 to item/product page.
  4. Add h1 element to Category/Group pages.
  5. Title tags and meta descriptions

SEO Basics

For those of you just getting your feet wet when it comes to SEO, there are a few basic on-site optimization fundamentals that should never be overlooked, especially if you plan on driving traffic from the search engines in a competitive market. There are three main factors, the title tag, the h1 tag and the inbound anchor text to your page for successful ecommerce seo.

It is important that each page have a unique title tag and h1 tag that closely match (contain the targeted keyword phrase). The h1 tag is often and mistakenly used in the logo and is not unique to each page.  In Google’s algorithm, any content in the h1 element is more important than any other content on the page. For more on the H1 tag you can read Scott Hendison’s explanation or checkout this SEO basics article (third step).

Removing The Products Page Headline Title

WP e-Commerce uses the page template in order to display all products. For example, the products-page will contain a list of products that you choose in the setup. When you click on a category/group, that category or group will be displayed inside of the wordpress products-page. It will send a string to the URL so it may look something like: site.com/products-page/test-category

Since the wordpress products-page is always present, the title (headline) for the page will remain no matter what category or product you are viewing and will say “Products Page”. Lets get rid of the page title for the products page so we can use h1 tags that are related to our products.

The Page/Post title is featured above the content and is displayed in the page.php template with something like this (this is your general wordpress theme, not the WP e-Commerce theme):

Lets tell wordpress to display the page title as long as the page is not the “Products Page”.

Add H1 Element To Items Page

Not to be confused with what Wordpress calls the “Products Page”, this is the page where your individual products are for sale. For example the page would be:

site.com/products-page/example-category/another-test-product/

In products_display_functions.php on line 645 you will find the following code.

$output .= "

$special" . stripslashes($product['name'])."

\n\r";

Change the h2 elements to h1 elements.

      $output .= "

$special" . stripslashes($product['name'])."

\n\r";

You will need to play around with the stylesheet to get the look you want, I am not going to go to in depth into the design process here. But, In the iShop.css, look for h2.prodtitles and create another style with h1.prodtitles. If you use the same attributes, will get the same look as the h2 elements.

H1 Element On The Categories/Groups Page

You will need to edit the core WP e-Commerce files in order to get the h1 element included at the top of the categories pages. The category pages are sometimes referred to as group pages. It is important to name them with the proper keyword that you are targeting.

Open products_page.php in your favorite text editor. You will find the following code starting at line 63.

 if($_GET['product_search'] != null) {
					echo "".TXT_WPSC_SEARCH_FOR." : ".stripslashes($_GET['product_search'])."";
				} else {
					$category_image = '';
					if((get_option('show_category_thumbnails') == 1) && ($category_data['image'] != null)) {
						$category_image = "";
					}
					echo "".$category_image."".stripslashes($category_data['name'])."";

On line 64 replace the strong element with the h1 tag. Remember to replace the closing tag with it is well and leave the class=”cattitles” the same. Do the same thing on line 70 since it is an if/else statement.

This is how the code should look after you are done (you could just copy and paste if you like).

if($_GET['product_search'] != null) {
					echo "

".TXT_WPSC_SEARCH_FOR." : ".stripslashes($_GET['product_search'])."

"; } else { $category_image = ''; if((get_option('show_category_thumbnails') == 1) && ($category_data['image'] != null)) { $category_image = ""; } echo "".$category_image."

".stripslashes($category_data['name'])."

";

Title Tags And Meta Descriptions

The title tags and meta description hack was a little bit more involved. Most of it, actually all of it, is done outside of the WP-e-Commerce plugin. First of all, before you can test the description tag, make sure that your categories/groups have a description added to them, since this fix uses that content as the description tag for the category pages.

I built this script based on this one, I modified it to include a title tag for the products page itself. I also added the meta description capabilities.

The category pages function determines that it is indeed a category page, queries the database for the category name and puts it into the title tag. It also takes the first 150 characters of the category description and puts it into the meta description tag

The item (actual product) pages function does the same thing as the category pages function, except that it makes sure you are on the product page. It replaces the title tag with the product name and blog info (you need to edit script to put your blog info in). It also includes the first 150 characters of the first description in the meta description tag.

The title tag and meta description for the main products page(products-page) is added manually when you install the script. Simply, replace, “My Products Page Title” with the appropriate title tag.

I normally use a plugin to add the meta description tag, but that plugin conflicted with WP e-Commerce. So I am using SEO Title Tag and wrote the next part of the script to add the description tag. Basically, it simply adds the description tag to every page that is not on the products page by adding the first 150 characters of the post.

This goes into the main Wordpress header template where your normal title tag would go.

".$productname." | site name
";
}
///////// Function to Find Category Name /////////////
function oGetCategoryName( $nicename ){
global $table_prefix;
$query = "SELECT name, description
FROM ".$table_prefix."product_categories
WHERE `nice-name` = '".$nicename."'";
$result = mysql_query( $query );
$row = mysql_fetch_array( $result );
$name = $row['name'];
$description = $row['description'];
//Category Title Tag and Description -- Change the name below to reflect your site
return "".$name." | site name
";
}
//this if state will determine if we are on the products page, the category page or the actual products page (item page) and call the appropriate function
if(get_the_title() == 'Products Page' ){
$pparts = explode('/', trim($_SERVER['REQUEST_URI'],'/') );
if( $pparts[2] != '' ){
echo oGetProductName( $pparts[2] );
}
else if( $pparts[1] != '' ){
echo oGetCategoryName( $pparts[1] );
}
//if we make it this far in the if statement, than we know that we are on the main products-page listing what you have for sale, manually edit this to reflect what you want the title tag to be and what description you want to use.
else {
?> your title tag for home

<?php if (function_exists('seo_title_tag')) { seo_title_tag(); } else { bloginfo('name'); wp_title();}
?>

Alright, you should be well on the way to a nicely optimized WP e-Commerce site.

Related posts:

  1. SEO WP e-Commerce Plugin Now Available Today I released the first version of SEO WP e-Commerce....
  2. E-commerce SEO SEO E-commerce Solutions E-Commerce: To Sell or Not To Sell...
  3. E-commerce SEO 101 – A Guide To Successful Ecommerce SEO Search engine optimization for an ecommerce store can be a...
  4. Ecommerce SEO Focus – Long Tail Rules The Day I have been working on several small ecommerce sites...
  5. Adding products to the home page of magento – Amazon.Com Style I have been experimenting with Magento and seeing how well...

You should sign up for my RSS feed here

55 Responses to “WP e-Commerce SEO Tutorial”

  1. Powerplates says:

    I found this tutorial very informative. You have posted such a useful article. It’s really helpful for the readers. I must appreciate your hard work which you shown in this post. Thanks ans keep posting stuff like this.

  2. Thanks for providing such a nice and useful website. This is one of the best blog which I have ever found on the net.

  3. irma says:

    why many people say it getting error .. ? is it really doesn’t work…?

  4. Bestimweb24 says:

    A rather long instructions in my view, what would it be with the plugin All in One SEO Pack which I had in my blog einsatzt with the WordPress plugin shop, it all works together beautifully without any problems.

Leave a Reply