How to Tweak WordPress Themes for Better Search Engine Placement

In this post

In this post, I'll outline how to tweak WordPress themes for better search results complete with code examples you can copy and paste.

How to Tweak WordPress Themes for Better Search Engine PlacementI’m an avid WordPress fan that has been using the blogging platform since 2003 when it was released to the Internet community. The following post will outline several tips you can use to tweak WordPress Themes complete with code examples.

WordPress is great out of the box, but as a guy who has been employed as a search engine optimization specialist there are some tweaks and widgets that can be added for better search engine placement. Not only will the code outlined here help you getting better search engine ranks, but it will also make your blog more complete by providing page content.

Sound good? Yes it does so lets dive into how to tweak WordPress themes complete with code examples you can copy and paste.

Automatically Generate Page Content with your Description Meta Data that’s SEO Friendly

Lengthy title I know, but it really sums it up in one sentence. With the following code I’ll show you how to use your meta description on your page that gets crawled by the spiders. You should already be following some rules when you write your content and meta description if you want to have a successful blog. For instance…

3 Bonus SEO Tips for Better Search Results

  • Your title shouldn’t be longer than 55 characters. This is all that shows up in search results and will get clipped off after the character count gets higher than that.
  • Your meta description should use your page keywords intelligently, but also create a compelling description that a searcher will want to click. Your description should sum up your post in between 150-160 characters.
  • Include your targeted keyword in your page title tags.

More about search engine optimization in this post.

tweak wordpress themes

Ok let’s get back to the subject of tweaking your WordPress template. In this first tip we’ll be editing your “single.php” file.

Your single.php file can be found in wp-content > themes > your theme folder.

A prerequisite for this tip is installing the Yoast SEO Plugin. It’s 100% free. In my opinion, this should be part of the core build of WordPress as it adds so many SEO benefits for beginner bloggers to pro bloggers like myself alike. If you’re already using this plugin you may want to consider buying the Yoast SEO pro version here.

What we’re doing here is pulling your meta description from the Yoast SEO plugin and displaying it on your page. This is good for SEO as it is index-able by the search engine spiders and it also provides page content in widget form.

I added this code at the beginning of my page to sum up what the page is about making it even easier for my readers to scan what they’re about to read. If you pay attention to your page description this code will add content to every post on your blog immediately.

This same widget can also be added to your categories and project pages for more SEO goodness. Locations of the files you’ll need to edit are further down this post.

Tweak WordPress Themes Template by Adding an Auto Generated Better Click to Tweet Widget

I know another log title, but again this sums up what we’re going to do next. While you have your single.php file open add this bit of php code to it to create and automatically generated Tweet widget to your page that pulls from your title tag.

For this tip you’ll need to have another plugin installed. Don’t worry it’s free and it’s light. The Better Click to Tweet plugin adds a widget to your page for readers to easily tweet your post to their followers. I get a lot of website traffic from Twitter so this plugin was a no-brainer for me.

Tweak WordPress Themes Template Categories

This tip employs the first tip in this post to your category pages. For some reason the default WordPress installation currently doesn’t employ this practice which is crazy. Adding meta info to your category pages makes them more friendly to the spiders by giving them information about the category your posting to. This promotes multiple posts and deeper blog posts automatically so it’s a good idea to do this if you have content that you want people to read.

In this post we’ll be adding the same code from the first tip to “archive.php“.

Your archive.php file can be found in wp-content > themes > your theme folder.

Here’s the code you’ll want to add again.

Tweak WordPress Themes Template Breadcrumbs

If you don’t know what breadcrumbs are they’re the bit of code normally found near the top of your page that shows your link hierarchy. This is important for promoting categories, page navigation and ease of use. Again using the Yoast SEO plugin can help add these to your pages if you don’t have them already. If you don’t currently have breadcrumb trails on your blog you really should. Readers like them and so do the spiders.

tweak WordPress themes
Image courtesy of

In the template I’m using there were no breadcrumb trails in my projects. This was remedied by adding code to “single-project.php” file.

Your single-project.php file can be found in wp-content > themes > your theme folder.

Your bread crumbs wont automatically pull the home of your blog or the project category with this code so you’ll have to hard code it. I’m sure there’s a way to do this dynamically using php, but that will be for another post. This tip can also be added to your category files if you don’t already have breadcrumbs; mine didn’t, by adding this code to your archive.php file. By the way this is the file that creates your category pages in most templates. It makes sense, but you’ll waste your time if you’re looking for category.php.

Tweak WordPress Themes to Promote Older Posts

A good way to promote old posts is to create a link that generates a link to random posts on your blog. Spiders crawl this link to pages or posts that don’t often get much attention because they are older.

I applied this code in a couple different places on my website. Most notably in the drop down menu of my about category. I call it “Tip Roulette”. This link will bring you to a random post on my website.

I detailed a post on how to do this complete with code examples you can copy and paste on the following post.

Generate Random Blog Posts to Promote Deep Web Links

That’s all for today bloggers. If you liked this post please share it with your favorite social networks. If you didn’t like this post please share it with your favorite social networks.



How to Tweak WordPress Themes for Better Search Engine Placement Click To Tweet