logo
Currently Browsing: Content Management Systems

Adding Meta Description Tags for Archive Pages in WordPress

logo

In order to track SEO metrics for my clients, I use the SEOMoz Pro service, which is a handy tool at monitoring SEO metrics (and so much more). I’ve noticed on one of the sites I manage through the service that I’ve been missing a number of meta description tags.  For those unaware, meta description tags are used to give a brief and concise summary of content on a page.  This helps search engines and potential readers understand what’s on the page.  The meta description info is also often used in page summaries in search results from engines like Google.  The below example is one from my music site, Electric Mohawk.meta description search example Adding Meta Description Tags for Archive Pages in WordPress

The example demonstrates the importance of meta description tags in SEO quite clearly.  I noticed, though, that some of my pages on Electric Mohawk are turning up as missing meta description info in their tags.  A prime example for my site is archive pages.  My sites are typically built using WordPress, so archive pages are dynamically generated and compiled, usually based on the month content was published.

I typically do not make my archive pages searchable for SEO purposes, but some people may still want them archived and may still want them to include a basic description.  The problem is, though, that many of us already use an SEO plugin of some sort, particularly All-in-One SEO Pack, where users do not get direct access to creating meta description tags for certain dynamically generated pages (any kind of archive page or page-navi generated page).  Another issue is that by creating another meta description tag to compensate for this in the header.php file would cause duplicate description tags to be created if the content is not an archive page.  I’ve created a simple workaround for WordPress archive pages to solve this problem.

Add this piece of code to your theme’s header.php file:

  1. <?php if (is_month()) {echo ‘<meta name="description" content="’; the_time(‘F, Y’); echo ‘ archive page for Electric Mohawk."/>’;}?>

What this code is doing is simple.  The if statement checks whether or not the page is an archive page. If it is an archive page, then it will echo out a portion of the meta description html tag.  In between, I made a call to the_time() function that passes in the month and year. I then created another echo that gives the actual description.

Some of you may be wondering why there are two echo statements instead of a simple string concatenation.  While I was debugging and testing out this code, the date would appear before the initial HTML tag, causing problems with formatting and validation.  Creating a second echo seemed to solve the problem.  Also, if the statement evaluates false, no additional tags will be generated.

I hope this snippet helps you out in some way. Have an alternative? Feel free to share!

Quick Tip: Filter Categories from WordPress Blog Page

logo

wordpress Quick Tip: Filter Categories from WordPress Blog Page

With Electric Mohawk, my music blog, I receive a lot of daily press releases from PR agencies. Unsure of how I wanted to deliver this content to the site, I finally decided on creating a category page on the blog that showcases these releases.  Problem solved, right?  Well, not entirely.

After thinking about it more, I didn’t want my blog’s main feed getting filled with a ton (at least 10) press releases everyday, as I would like the home page to focus on other content.

In my time, I’ve learned that WordPress can do some pretty awesome things, like custom filters.

Here’s how I filtered out my “Press Releases” category from Electric Mohawk:

  1. /* The Number 611 is my category ID number. Please replace this with your own!
  2.            Add this snippet to your functions.php file. */
  3.  
  4.         function exclude_cat($query) {
  5.                 if ( $query->is_home) {
  6.                         $query-> set(‘cat’,‘-611′);
  7.                 }
  8.                 return $query;
  9.         }
  10.  
  11.         add_filter(‘pre_get_posts’,‘exclude_cat’);

Want this snippet in plain text? Here: Filter categories snippet a la text.

This code snippet should be placed in your functions.php file located in your theme’s folder.

Here’s a breakdown of how the code works:

What the code is doing is initially creating a filter function that excludes a category based on its ID number.  First, you’re checking for the blog page. is_home() applies to the blog page at large, even if it is not your home page, per se (for more information, do a comparison of is_home() and is_front_page()).

Next, you’re going to assign the $query variable (property of the WP_Query class) the filter value using the set (key, value) method, where the key is the category (cat), and the value is your category ID (an integer).  In my situation, my category’s ID that I wanted to filter out was 611.  The reason why the value is negative is because we want to remove the category.  After that, the $query variable is returned.

Finally, you’ll want to add the filter.  You want this filter to be applied before WordPress fetches the posts from the database, so I used the pre_get_posts hook that’s built into WordPress.

That’s about it. Remember, this snippet should get added to the functions.php file located in your theme’s folder.

Questions? Leave them in the comments. Your questions are always welcome here.

FoxyPress Demo Store Released

logo
FoxyPress Demo Store Released
foxypress demo store FoxyPress Demo Store Released

FoxyPress Demo Store

FoxyPress, a WordPress plugin that integrates the FoxyCart E-commerce system into the popular CMS, has now launched a demo store where visitors can test out the plugin real-time.

A few things to consider when testing out the plugin:

  • Be aware of the differences between Subscription Management and Order Management between main and subsite installs.
  • You can mock purchase items in the store. No credit card numbers are stored. PayPal Objects has test credit card accounts that you can use instead of real ones.
  • Affiliate management is also included in the demo store. Awesome.
  • There’s also other plugins that mesh well with FoxyPress that are installed in the demo site. For any questions about these plugins, contact FoxyPress.
I’ve been witnessing this plugin’s transformation from a simple idea to a fully-fledged and enterprise level plugin and I am very impressed with what the team has managed to accomplish. I will say that there’s some pretty powerful improvements and enhancements in the horizon, but I will leave that for a later time.

FoxyPress 0.3.4 Released!

logo

foxypress new site FoxyPress 0.3.4 Released!
FoxyPress 0.3.4 rolled out today, which adds some new features, improvements, and bug fixes.

Features/Improvements:

  • Per user request, FoxyPress added a packing slip wizard to be used for partial orders, which is handy for returns or back-ordered items.
  • HMAC Form Code added; no more form tampering
  • Additional setting added to Manage Settings Page to control if our default FoxyPress stylesheet is included.
  • Per user request, SMTP Mail settings added to Manage Settings Page – useful for overcoming server relay trouble.
  • Added Quantity available in the product grid – hide from screen options if you do not need this.

Bug Fixes:

  • New products now have the default category applied.
  • Showing correct price/sale price on manage products page now.
For more information on the latest FoxyPress release, you can view the release notes.

FoxyPress 0.3.3 Now Released!

logo

foxypress new site FoxyPress 0.3.3 Now Released!

WebMovement, LLC has come a long way with the development of their plugin that integrates the FoxyCart e-Commerce system with WordPress.  The latest release adds a ton of features as well as user customizations that make product pages more SEO friendly.

Here are some of the new features released in 0.3.3

  • FoxyPress is now multisite compatible. This means that FoxyPress can add, remove, and manage multiple stores in a WordPress multsite setup.
  • Products are now custom post types in WordPress. This means that users can now give custom URLs and slugs to products managed using FoxyPress. This is a great and major improvement from an SEO perspective.
  • API now queries products for custom templates.
  • Support for FoxyCart Single Sign On. This syncs WordPress users and FoxyCart users so that multiple logins for individual users are no longer required.
  • Subscription Support

On a sort of unrelated note, a new site design has been launched in celebration of the new release. See the screen shot above or check out the FoxyPress redesign firsthand.
Want to learn more about the update and new features? Check out the updated Features, Getting Started, and FAQ sections.

Page 1 of 512345
logo
Powered by Wordpress. Copyright 2009 Brett Widmann.