10 WordPress hacks to make more money online

WordPress is a very powerful blogging engine, which serve content to billions of readers on a daily basis. But not only: WordPress can be used in a wide variety of ways: Photoblog, online magazine, classified site… And with all that power, WordPress can also help you to make more money online than a simple site or a blogger blog.

In this article, I’m going to show you 10 powerful and easy to implement WordPress hacks to make more money online.

Insert ads in your RSS feed

[tweet]RSS feeds are the new newsletters. Everyday, more and more people use RSS to access content from their favorite websites, so what about monetitizing yours?
Simply paste the following code on the functions.php file from your theme. Create that file if it doesn’t exists by default.
Once saved, ads should be displayed on your blog RSS feed!

function insertRss($content) {
        $content = 'text before content'.$content.'<hr /><a href="http://www.wprecipes.com">Did you visited WpRecipes today?</a><hr />';
    return $content;
add_filter('the_content', 'insertRss');

Source : http://www.webinventif.fr/wordpress-ajouter-du-contenu-dans-son-flux/

Display ads to search engines visitors only

It is a well known fact in the world of internet marketing that people coming to your site from search engines have more chances to click on your ads than your regular visitors.
In order to avoid AdSense “Smart Pricing”, you should definitely only display your ads to visitors coming from search engines.

To do so, we first have to create a function. Paste the code below in your theme functions.php file.

function scratch99_fromasearchengine(){
  $ref = $_SERVER['HTTP_REFERER'];
  $SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
  foreach ($SE as $source) {
    if (strpos($ref,$source)!==false) return true;
  return false;

The $SE array is where you specify search engines. You can easily ad new search engines by adding new elements to the array.

Then, paste the following code anywhere on your template where you want your ads to be displayed only to visitors comming from SERPs.

if (function_exists('scratch99_fromasearchengine')) {
  if (scratch99_fromasearchengine()) {

Source : http://www.wprecipes.com/how-to-display-adsense-to-search-engines-visitors-only

Make your title tag SEO friendly

I recently talked about the benefits of having an optimized <title> tag. After the theory, let’s dive into the practice.

Open your header.php file for edition. find the <title> tag, and replace it by the following:

<?php if (is_home () ) {
} elseif ( is_category() ) {
    single_cat_title(); echo ' - ' ; bloginfo('name');
} elseif (is_single() ) {
} elseif (is_page() ) {
    bloginfo('name'); echo ': '; single_post_title();
} else {
} ?>

This code will generate SEO optimized title tags according to the following model:

  • If the visitor is on the blog homepage: We’ll display the blog name.
  • If the visitor is on a category page: We’ll display the category name and the blog name.
  • If the visitor is on an article page: We’ll only display the article title.
  • If the visitor is on a static page: We’ll display the blog name, and the page title.

Note that if you’re, like me, using the super cool Thesis WordPress theme, you don’t need to implement that hack. Thesis do it by default!
Source : http://www.wprecipes.com/how-to-make-your-title-tag-seo-friendly

Allow your visitors to send your posts by email

Althought I personnally almost never send “Your should visit that page” emails to my family or friends, lots of Internet users are doing it.

This is definitely a good thing for website owners, because it bring new visitors, and they can become regular readers. This is the reason why you should implement this pretty nice function to allow your visitors to send your blog posts by email.

Paste the following function to your functions.php file.That’s all. Hard to do something simpler 😉

function direct_email($text="Envoyer par mail"){
        global $post;
        $title = htmlspecialchars($post->post_title);
        $subject = 'Sur '.htmlspecialchars(get_bloginfo('name')).' : '.$title;
        $body = 'Je recommande cette page : '.$title.'. Consultable à cette adresse : '.get_permalink($post->ID);
        //$body .= '. Extrait: '.$post->post_excerpt; // http://www.webinventif.fr/wordpress-hors-boucle/
        $link = '<a rel="nofollow" href="mailto:?subject='.rawurlencode($subject).'&amp;body='.rawurlencode($body).'" title="'.$text.' : '.$title.'">'.$text.'</a>';
        return $link;

Source : http://www.webinventif.fr/wordpress-lien-envoyer-page-mail/

Automatically insert content after each post

On most blogs, bloggers ad some stuff after the post content: Advertisments, related posts or these “Subscribe to RSS feed” boxes.
Whatever you want to display, this solution is pretty good for that. Sure, you can “simply” edit your theme single.php file, but using this method, your message will stay even if you switch themes.
One more time, you just have to paste the function into the functions.php file eused by your theme.

function insertFootNote($content) {
        if(!is_feed() && !is_home()) {
                $content.= "<div class='subscribe'>";
                $content.= "<h4>Enjoyed this article?</h4>";
                $content.= "<p>Subscribe to our  <a href='http://feeds2.feedburner.com/WpRecipes'>RSS feed</a> and never miss a recipe!</p>";
                $content.= "</div>";
        return $content;
add_filter ('the_content', 'insertFootNote');

Source : http://www.wprecipes.com/how-to-automatically-insert-content-after-each-post

Display a Tweetmeme “Retweet” buton where, and when you want

Tweetmeme have a pretty cool service which allow people to share your blog post on Twitter. If you don’t already pay a lot of attention to Twitter, you have to know that it is know one of the bigger traffic provider on my blogs, as well as on very popular ones as such as Mashable or Smashing Magazine.

This hack is very easy to implement. You just have to copy the following code, and paste it into your function.php file.

function tweetmeme(){
	return '<div class="tweetmeme"><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div>';
add_shortcode('tweet', 'tweetmeme');

Once done, you can display the Tweetmeme “retweet” button anywhere on your posts. In WordPress editor, make sure you are in HTML mode and insert the following:


Source : http://www.wprecipes.com/wordpress-tip-create-a-tweetmeme-retweeet-shortcode

Detect IE6 (And open popups!)

If you’re a Cats Who Code reader, there no doubt that you know how much I hate Internet Explorer 6.
But as an Internet marketer, IE6 also have good points : As an obsolete browser, some of its versions do not have any anti pop-up blockers. Which means that you can do a real pop-up fiesta to each of your beloved IE6 users and make some money.

After all, as a profesionnal web developer IE6 was the cause of many headaches and night work. So, it is worth a pop up or two (or more).

To implement this hack, just open your header.php file and paste the following.

<!--[if lte IE 6]>
   <!-- insert your ad script here -->

Cloak affiliate links

Whenever you talk about any kind of products on your blog as such as WordPress themes, hosting, or even plane tickets, there’s for sure some affiliate link to grab in order to make some money.
But some people, who wants to make money too, will join the same affiliate programs and sign in using their own link, instead of yours. And as you probably know, in the world of affiliate marketing, most of the time it is the first clicked link who’ll bring money to the site owner, so you have to “hide” your affiliate links.

You can do it using various method: A simple url shortener, a plugin as such as Redirection (I use it on all my blogs) or even a dedicated free service named aCloaker.

Display Adsense with a shortcode

Adsense is hard. On some pages, clicks can make you earn $2, while they are just $0.10 on some other. To optimize your Adsense earnings, you should definitely implement Adsense only when you want to.
This nifty hack will allow you to do it easily.

One more time, you have to open your functions.php file and paste the following code in it. Remember to change the Adsense code, or my ads will be displayed instead of yours!

function showads() {
    return '<script type="text/javascript"><!--
    google_ad_client = "pub-3637220125174754";
    google_ad_slot = "4668915978";
    google_ad_width = 468;
    google_ad_height = 60;
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

add_shortcode('adsense', 'showads');

Once you inserted the code and saved your functions.php file, you’ll be able to embed your adsense code on your posts and display it exactly where you want. To do so, simply paste the following code on the editor, in html mode:


Source : http://www.catswhoblog.com/how-to-display-adsense-ads-only-when-you-want-to

(Try to) block AdBlock

If you want to get info from a book, you have to buy the book and read it. With blogs, you can access millions of interesting pages for free. Bloggers don’t want people to pay for their content, because advertisment is bringing their income.

Sadly, some people who don’t understand that if a blogger don’t make enought money with blogs, he’ll have to take a daily job and stop blogging. Some nasty people who want to access info without giving anything back created a Firefox plugin named AdBlock. Its purpose is to block ads, which is definitely a bad thing for our businesses.

To implement this hack, you have to embed all your ads within a specific css class. It is called myTestAd in this example:

<div class="myTestAd" style=" text-align:center;margin:10px">
    <!-- advert code goes here -->

Once done, we have to verify that the iframe element doesn’t have a height of 0. Using MooTools, we can come up with that code:


function TestPage() {
    if ($E(".myTestAd iframe").clientHeight == 0)
        alert("You are blocking my ads, you swine!");

Source : http://www.thepcspy.com/read/how_to_block_adblock

That’s all for today! Hope you’ll make lots of $$$ with my hacks 😉 Happy blogging everyone!

Published on November 8th, 2009 by Jean-Baptiste Jung

Leave a Reply