Experiment with Description Snippets

I just removed H2 elements from archive page posts on this blog; I want to see what effect that has on how Google snippetize my archive pages. HOPEFULLY I didn’t just shoot myself in the foot, but what the hell - I’m in the mood for a little experimentation. BTW, this is a follow up to my previous post about how I think Google snippetizes a page. Note: The point of this excercise is not to rank higher. The point is to 1) learn how Google operates and 2) to avoid supplemental listings without using META descriptions (Look ma, no hands!).

BEFORE (post titles are wrapped in H2):

Wordpress archive.php template

AFTER (h2 removed):

Wordpress archive.php template

What effect will this have when I run site: on Google a few weeks down the road?

BEFORE (this is how my listing actually looks right now):

Google SERP description snippet before

AFTER (image below was taken from my Google Notebook. I’ll have to wait a while to see the actual outcome):

Google SERP description snippet after

“Archive for May, 2006″ is the first H2 text on that page, but it’s followed by another H2 which I think cancels it out. By removing the post H2, I’m hoping the first H2 text gets included in the description snippet. “Google Co-op Annotation…” is the post title for the first post on that archive page. Since it’s separate from the post excerpt wrapped in P, I’m not sure if it’ll get skipped over or not. I’ll bet a buck and a half it won’t get skipped over.

P.S. I realize now my archive pages are harder on the eyes. I’ll work on that later.

Since my main machine is fried and I don’t have access to Dreamweaver, I used Faststone, SmartFTP and Photoshop to work images into this post. Surprisingly, its way quicker this way than using Dreamweaver.

Ideally, I want to wrap everything (post title, date, excerpt) in P. But doing that requires an involved hack which I think is way too much hassle. I still wrote it down below, in case I change my mind later and implement it.

$post_excerpt is just a DB field. An easy hack here is use str_replace to strip out the P and /P in get_the_excerpt().

In wp-includes/template-functions-post.php, line 109:

$output = $post->post_excerpt;

Replace that with:

$replacement = array(”<p>”,”</p>”);
$output = str_replace($replacement, “”, $post->post_excerpt);

Now, just wrap excerpt text in P on your archive/index templates.

WARNING: This hack is completely untested. I take absolutely no responsibility if using it completely wipes your blog off the face of Google. You’ve been warned.

Related Posts

What's Your Take?