How to Instantly Get More Pageviews for Free

How to Instantly Get More Pageviews for Free

shoemoney · · 2 min read
A few months ago during the redesign of ShoeMoney.com I noticed this area next to our social links: At the time there was a random post being displayed. Sure, that would have gotten some clicks but it occurred to me that there had to be a better way. Obviously some posts are better than others, and it doesn't make any sense to rotate through low quality posts when there are the gems that people love but may be a few years old and the new ShoeMoney.com reader might not ever see them. So here's what I did: We went through and tagged a selection of posts that we considered the "Best of ShoeMoney". Then I added some simple code to the header file so that it would execute on every page load. The code checks to see if the current page being loaded is a "Best of ShoeMoney" post, and if it is, it adds it to a cookie on the users machine. if(is_single()) { $tags = get_the_tags(); foreach($tags as $tag) { if($tag->name == "Best Of ShoeMoney") { if($_COOKIE) { $seen_posts = unserialize($_COOKIE); } else { $seen_posts = array(); } if(!in_array($wp_query->post->ID,$seen_posts)) { array_push($seen_posts,$wp_query->post->ID); } setcookie('haveuseen',serialize($seen_posts),time()+(60*60*24*365),'/','shoemoney.com'); } } } Finally, in the template code I run a get_posts() and exclude the posts in the cookie that people have already seen. This way, on every page load they are exposed to a "Best of ShoeMoney" story that they haven't read yet. The result? Posts that were completely dead with traffic suddenly saw a spike when it was implemented: Send this post to your programmer and have them implement this today for an instant boost in pageviews!