[Hack] Wordpress Date Hacks - Cheat Google Freshness SEO

TheTK

Registered Member
Joined
Aug 12, 2013
Messages
58
Reaction score
94
header.png


As a long time lurking web dev whose been doing ok making money online I decided to start blogging about my journey and giving back to the community! Here's my first major post, with methods, code snippets and even a free plugin! :D Hope you enjoy ~TK


I doubt you've not seen the outcry that popular SEO hype bloggers have been throwing out there when it comes to how Google's algorithm is responding to freshness. They'll bitch and they'll moan and say things like:


quote13.png


and to be fair they aren't wrong. The problem is they'll complain a bit more and rather than give you any methods to do anything about it they simply try and sell you on their SEO course.


So now I'm going to show you some of the various methods for playing around with WordPress post dates so that you can take advantage of Google's over the top love of freshness!


But before we dive on in make sure you've disabled your "post date" under the Wordpress > Permalinks like so:


1.png



By doing this you ensure that you can send new article publishing dates without getting busted by Google and or having a messed up RSS feed!


m11.png

This method is specifically handy for when you are looking to make content seem like it was posted today; and while this is ok for search engines it's especially powerful when advertising things to people as they like to think they are getting the latest information, the latest software etc. So this is great to use on your affiliate pages!


Code:
?<?php the_time(?F jS, Y?) ?>?

It's worth noting that not all themes use the same functions or put them in the same place. You may have to poke around a bit to find yours!


From there open your "Functions.php" under your wordpress editor and add in the following code:


Code:
// Sunday, September 1st, 2013
function displaydate(){
return date(?l, F jS, Y?);
}
add_shortcode(?date?, ?displaydate?);
// end date
Now when ever you the word date in square brackets [] it will display today's date like so: [date]


m21.png



Now we're gona take a look at two plugins that can help you do the same thing, but are much better targeted at search engines than anything else. It's methods like these that you'll use to have your posts always appear fresh:


1day.png



The first plugin was an offer priced WSO that allows you to display the dynamic date of your content with the following features:


promo.png


But rather than make you pay for that plugin, I went ahead and bought a copy to share with you!


http://tkseo.co/wp-content/uploads/2013/09/Dynamic-Date-Plugin-DD-MM-YYYY-Format.zip - Note, not my plugin original WSO is http://www.warriorforum.com/warrior-special-offers-forum/81140-wordpress-dynamic-date-plugin-great-one-time-offers-squeeze-pages-landing-pages-more.html


and you can find the instructions http://wp-internetmarketing.com/how-to-use-the-wordpress-dynamic-date-plugin/


I would use this plugin when you are running a blog and want to keep things in order for your regular readers, but want to have the search engines and traffic that comes in from SEO think that everything is new!


m3.png



This next method is also a plugin (and an awesome open source one) that I highly recommend. It's called http://www.blogtrafficexchange.com/old-post-promoter/ and it was made by the guys at BlogExchange.


The difference between 'Old Post Promoter" and "Dynamic Date Plugin" is that Old Post Promoter doesn't just change the date of the piece it actually bumps it back to the top of your blog by re-publishing it and sends the new post back to your Wordpress RSS feed.


As the post appears back at the top of your blog, you can see why this method would be a little chaotic for anyone who ran an actually blog. But if it's just for SEO promotion then Old Post Promoter is the way to go!


how.png



Obviously there are about 1000 different ways to make money with these methods, and most of you will just be applying them to existing money sites. However I'm going to quickly outline a favourite of mine that I call "Youtube Date Push"


The Youtube date push is a simple concept pick a niche with good affiliate potential (for example I used to do it for hosting reviews), and create a number of videos for that review. I'd create 20 - 30 of them each targeting different keywords and phrases. Write up an accompanying blog post, embed the youtube video (bonus: turn on adsense for youtube) and then set up Old Post Promoter to cycle through the various posts bumping them every so often.


Be sure to install http://wordpress.org/plugins/xml-sitemaps-for-videos/ and run it frequently. Also as long as you turned off dates in your permalink settings you can continue to build backlinks to those pages as even when OPP bumps it the URL will stay the same.


nwp.png


While it's much easier to do with Wordpress there are certainly ways that you can hack dynamic dates without using a CMS platform. Yet they won't be picked up as well by the Search Engines.


One thing that does work on occasion is if you've already set up "Google Verified Authorship" you'll know you have to put in a "By" line that says who the author of each page is. Underneath that you can put:


Code:
?Posted On: <?php echo date('l jS F Y'); ?>?

(and as long as you are using PHP) then today's server date should automatically load. While this won't have the same effect as OPP when Google re-crawls your site it will often grab that date as it grabs the byline.
 
Thanks for this post. I've heard about how Google emphazises on freshness and the WSO plugin will come in handy.
 
Thanks for this post. I've heard about how Google emphazises on freshness and the WSO plugin will come in handy.

Thanks!

Another good plugin for this is Scheduled Post Shift Plugin for WordPress http://www.dagondesign.com/articles/scheduled-post-shift-plugin-for-wordpress/

Yup, certainly another handy one! I like that it specifically targets your oldest post and not just a random one - may be merit in that!
 
Oh really useful post . i will try the dynamic plugin on my blog now. Thank you
 
Holy heck mate I came on here to look for this thank you so much!
 
You revived my old blogs. Thanks +rep given!

Oh really useful post . i will try the dynamic plugin on my blog now. Thank you

Holy heck mate I came on here to look for this thank you so much!

Thanks guys, happy to help; and you're right this is not only a great way to game some freshness SEO for squeeze pages etc, but also a great way to take an old out of date site/blog and bring it back to life!
 
NICE SHARE!

So they dont really look at more than the date for freshness?
 
Yes, this is a worth share you deserve rep+ because I know most of people don't know about it.
 
NICE SHARE!

So they dont really look at more than the date for freshness?

It's not the only thing obviously, and just having fresh content may not rank you but it is a huge factor. It also depends on the niche you are in. Things like reviews, events etc value freshness more.

Yes, this is a worth share you deserve rep+ because I know most of people don't know about it.

true indeed! Not a common method! Thanks for the rep!
 
Lol i thought this was common sense ^^
Anyway, good share!

Common sense? This is undoubtedly one of the least talked about factors/methods in SEO currently. Even people who mention it rarely show you how to do it :P
 
Common sense? This is undoubtedly one of the least talked about factors/methods in SEO currently. Even people who mention it rarely show you how to do it :P

Sry ^^
I, somehow, thought everyone had basic knowledge of php ^^
As it is quite easy to make this kind of stuff with php, I thought of it as common sense :D:D
 
hi have 1000s of static pages on one wordpress blog (no posts) . Can i use the Dynamic Date plugin for that in a smart way? i dont want to manually put the <!--date--> tag in on all 1000 pages, naturally.. so where do i insert the tag for it to work on every page? (bare with me, im not a coder.. :) thanks for the great tip!
 
hi have 1000s of static pages on one wordpress blog (no posts) . Can i use the Dynamic Date plugin for that in a smart way? i dont want to manually put the <!--date--> tag in on all 1000 pages, naturally.. so where do i insert the tag for it to work on every page? (bare with me, im not a coder.. :) thanks for the great tip!

Sadly with static pages there isn't an easy solution (they also don't seem to pass along the same freshness info as a blog post would as search engines don't expect them to be as time relevant as a blog post).

Your best bet in all honesty would be to hire a freelancer to copy all the pages to blog posts and install Method 3: Old Post Promoter.

That way it will continue to cycle through the content. With 1000 static pages you'll always be delivering "new articles" and it should give your content quite a push!

If you do want to go through manually with the PHP date method it may also be wise to under each title use the Google Authorship (By: rel=author) and then put the date stamp right under it so Google grabs it in the same fashion as it would a blog post. Pretty time consuming and not as effective as converting them to posts.
 
it this method works?

I mean does it help in ranking?

please reply.
thanks
 
Try this:

PHP:
<?php
/*
Plugin Name: Scheduled Post Shift
Plugin URI: http://www.dagondesign.com/articles/scheduled-post-shift-plugin-for-wordpress/
Description: Automatically takes your oldest post and moves it to the front by updating its timestamp.
Author: Dagon Design
Version: 1.31
Author URI: http://www.dagondesign.com
*/


$ddps_version = '1.31';

add_action('admin_menu', 'ddps_add_option_pages');
add_action('ddps_postshift', 'ddps_postshift');



// Setup defaults if options do not exist
add_option('ddps_enabled', FALSE);
add_option('ddps_cat', '');
add_option('ddps_delay', 24);
add_option('ddps_onlyafter', 0);
add_option('ddps_logfile', ABSPATH . 'wp-content/plugins/dd-scheduled-draft-publish.log');

function ddps_add_option_pages() {
    if (function_exists('add_options_page')) {
        add_options_page('Post Shift', 'DDPostShift', 8, __FILE__, 'ddps_options_page');
    }        
}

function ddps_options_page() {

    global $ddps_version;

    if (isset($_POST['enable_post_shift'])) {

        ?><div id="message" class="updated fade"><p><strong><?php 

        update_option('ddps_enabled', TRUE);
        update_option('ddps_cat', stripslashes((string)$_POST['ddps_cat']));
        update_option('ddps_delay', (int)$_POST['ddps_delay']);
        update_option('ddps_onlyafter', (int)$_POST['ddps_onlyafter']);
        update_option('ddps_logfile', stripslashes((string)$_POST['ddps_logfile']));

        if ((int)$_POST['ddps_delay'] < 1) {
            update_option('ddps_delay', 1);
        }

        wp_clear_scheduled_hook('ddps_postshift');
        wp_schedule_event(((int)get_option('ddps_delay') * 3600), 'ddps_schedule', 'ddps_postshift' );

        echo "Post Shift Enabled!";

        ?></strong></p></div><?php

    } else if (isset($_POST['disable_post_shift'])) {

        ?><div id="message" class="updated fade"><p><strong><?php 

        update_option('ddps_enabled', FALSE);

        wp_clear_scheduled_hook('ddps_postshift');

        echo "Post Shift Disabled!";

        ?></strong></p></div><?php

    } else if (isset($_POST['info_update'])) {

        ?><div id="message" class="updated fade"><p><strong><?php 

        update_option('ddps_enabled', (bool) $_POST["ddps_enabled"]);
        update_option('ddps_cat', stripslashes((string)$_POST['ddps_cat']));
        update_option('ddps_delay', (int)$_POST['ddps_delay']);
        update_option('ddps_onlyafter', (int)$_POST['ddps_onlyafter']);
        update_option('ddps_logfile', stripslashes((string)$_POST['ddps_logfile']));

        if ((int)$_POST['ddps_delay'] < 1) {
            update_option('ddps_delay', 1);
        }

        if (get_option('ddps_enabled') == TRUE) {
            wp_clear_scheduled_hook('ddps_postshift');
            wp_schedule_event( time()+10, 'ddps_schedule', 'ddps_postshift' );
        }

        echo "Configuration Updated!";

        ?></strong></p></div><?php

    } else if (isset($_POST['clear_log'])) {
          $logfile=get_option('ddps_logfile');
          $fh = @fopen($logfile, "w");
          @fwrite($fh, strftime("%D %T")."\t<strong><font color=\"#FF0000\">Log file cleared</font></strong>\n\t─────\n");
          @fclose($fh);
      echo "<div id='message' class='updated fade'><p><strong>Log file cleared!</strong></p></div>";
        }
    ?>

    <div class=wrap>

    <h2>Scheduled Post Shift v<?php echo $ddps_version; ?></h2>

    <p>For information and updates, please visit:<br />
    <a href="http://www.dagondesign.com/articles/scheduled-post-shift-plugin-for-wordpress/">http://www.dagondesign.com/articles/scheduled-post-shift-plugin-for-wordpress/</a></p>


    <form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
    <input type="hidden" name="info_update" id="info_update" value="true" />


    <div style="padding: 0 0 30px 20px;">

    <h3>Current Status: <?php echo (get_option('ddps_enabled') == TRUE) ? 'Enabled' : 'Disabled'; ?></h3>

    <?php if (get_option('ddps_enabled') == TRUE) { ?>
        <input type="submit" name="disable_post_shift" value="<?php _e('Disable Post Shift'); ?> »" />
    <?php } else { ?>
        <input type="submit" name="enable_post_shift" value="<?php _e('Enable Post Shift'); ?> »" />
    <?php } ?>

    </div>

    <h3>Options</h3>

    <table width="100%" border="0" cellspacing="0" cellpadding="6">

    <tr valign="top"><td width="25%" align="right">
        <strong>Shift Delay</strong>
    </td><td align="left">
        <input name="ddps_delay" type="text" size="10" value="<?php echo htmlspecialchars(get_option('ddps_delay')); ?>"/>
        <br />The number of <strong>hours</strong> between post shifts
    </td></tr>

    <tr valign="top"><td width="25%" align="right">
        <strong>Only Shift After X hours</strong>
    </td><td align="left">
        <input name="ddps_onlyafter" type="text" size="10" value="<?php echo htmlspecialchars(get_option('ddps_onlyafter')); ?>"/>
        <br />Only shift a post if it has been X <strong>hours</strong> since the last new post was added (0 = disable)
    </td></tr>

    <tr valign="top"><td width="25%" align="right">
        <strong>Category ID(s)</strong>
    </td><td align="left">
        <input name="ddps_cat" type="text" size="10" value="<?php echo htmlspecialchars(get_option('ddps_cat')); ?>"/>
        <br />If left blank, the plugin will use posts from all categories
        <br />If you enter one or more category IDs, it will only update posts from those categories
        <br />Separate multiple category IDs with commas
    </td></tr>
    
    
        <tr valign="top"><td width="25%" align="right">
                <strong>Log File</strong>
        </td><td align="left">
                <input name="ddps_logfile" type="text" size="100" value="<?php echo htmlspecialchars(get_option('ddps_logfile')); ?>"/>
                <br />You can leave this specific to this blog, or set up a global log for multiple blogs.
        </td></tr>
        

    </table>

    <div class="submit">
        <input type="submit" name="info_update" value="<?php _e('Update options'); ?> »" />
            <input type="submit" name="clear_log" value="<?php _e('Clear Log File'); ?>" onclick="return confirm(\'Are you sure you want to clear the log file?\');" />
    </div>
    
    </form>
    
        
        <P>
        <h2>Scheduled Draft Publish log</h2>
        <p><code>
<?php
   PS_get_last_log_entries();
?>
    </code></p>
    
    
    </div><?php
}





function ddps_postshift() {

    $onlyafter = (int)get_option('ddps_onlyafter');
    $last_post_date = get_lastpostdate('blog');
    $current_date = current_time('mysql'); 
    $hours_passed = ((strtotime($current_date) - strtotime($last_post_date)) / 60 / 60);
    if (($onlyafter > 0) && ($hours_passed <= $onlyafter)) {
        return;
    }



    global $wpdb;


    $tp = $wpdb->prefix;

    // Currently using a work-around for the version system
    // determines if pre or post 2.3 from wp_term_taxonomy 

    $ver = 2.2;
    $wpv = $wpdb->get_results("show tables like '{$tp}term_taxonomy'");
    if (count($wpv) > 0) {
        $ver = 2.3;
    }


    $the_cat = '(' . trim(get_option('ddps_cat'), ',') . ')';


    if ($the_cat == "()") {

        $oldest_post = $wpdb->get_var("
        SELECT ID 
        FROM {$tp}posts
        WHERE post_type = 'post'
        AND post_status = 'publish' 
        GROUP BY post_date asc
        ");


    } else {

        if ($ver < 2.3) {

            $oldest_post = $wpdb->get_var("
            SELECT ID 
            FROM {$tp}posts, {$tp}post2cat
            WHERE {$tp}post2cat.category_id IN " . $the_cat . "  
            AND post_type = 'post'
            AND {$tp}posts.post_status = 'publish' 
            AND {$tp}post2cat.post_id = {$tp}posts.ID
            GROUP BY post_date asc 
            ");

        } else { // post 2.3+

            $oldest_post = $wpdb->get_var("
            SELECT ID 
            FROM {$tp}posts, {$tp}term_relationships, {$tp}term_taxonomy 
            WHERE {$tp}term_taxonomy.term_id IN " . $the_cat . "  
            AND {$tp}term_taxonomy.term_taxonomy_id = {$tp}term_relationships.term_taxonomy_id 
            AND {$tp}term_relationships.object_id = {$tp}posts.ID 
            AND {$tp}posts.post_type = 'post' 
            AND {$tp}posts.post_status = 'publish' 
            GROUP BY post_date asc
            ");

        }

    }
    
    

    if ($oldest_post > 0) { # we have a post to shift

        # what wordpress func to call for setting post_name instead?
        $post_title = $wpdb->get_var("
        SELECT post_title
        FROM {$tp}posts
        WHERE ID = '$oldest_post'
        ");
        
        # what wordpress func to call for setting post_name instead?

        $new_time = date('Y-m-d H:i:s');
        $wpdb->query("UPDATE $wpdb->posts SET post_date = '$new_time' WHERE ID = '$oldest_post'");
        
        wp_publish_post($oldest_post);
        
        SDP_log(strftime("%D %T") . "\t" . $tp . "\tPOST id " . $selected_draft . " SHIFTED  '" . $post_title . "'\n");

    } else {
          PS_log(strftime("%D %T") . "\t\t" . $tp . "\tUnable to find a post to shift.\n");
    }
}




function more_reccurences() {
    return array(
        'ddps_schedule' => array('interval' => ((int)get_option('ddps_delay') * 3600), 'display' => 'Post Shift Schedule')
    );
}


function PS_log($PS_log_output)
{
   $logfile=get_option('ddps_logfile');
   $fh = @fopen($logfile, "a");
   @fwrite($fh, $PS_log_output);
   @fclose($fh);
}

function PS_get_last_log_entries()
{
   $logfile=get_option('ddps_logfile');
   $lines = @file($logfile);
    if($lines === false){
     echo "Error reading log file (".$logfile."). <strong>Most likely you have manually removed the log file</strong>, or alternatively this could mean that the logfile is read-protected (change the rights of this file to 777)')";
    }else{
      $msg = "";
      foreach($lines as $line){
         $msg.=trim($line)."<br />";
      }
      echo $msg;
    }
}


add_filter('cron_schedules', 'more_reccurences');

?>

Scheduled Post Shift Plugin for WordPress

This plugin automatically takes your oldest post, and updates its timestamp so that it appears as the latest post on your WordPress site. It does this by utilizing the cron feature built into WordPress 2.1 (and newer). It can rotate all the posts on your site, or just ones in specific categories. You can currently schedule it by setting the number of hours between shifts. For example, set it to 24 hours and it will shift the oldest post every day, at the time that you enabled it. You can also choose to only shift a post if it has been more than a set number of hours since the last post.
Download




http://www.dagondesign.com/files/dd-scheduled-post-shift.txt

Instructions


  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory
  • Enable the plugin
  • Configure the plugin options (under DDPostShift)
  • Click the ?Enable Post Shift? button to start
Disabling the Schedule

To stop the schedule, simply click the ?Disable Post Shift? button on the options page.

http://www.dagondesign.com/articles/scheduled-post-shift-plugin-for-wordpress/
http://www.dagondesign.com/files/dd-scheduled-post-shift.txt

This Plugin works well for me.
 
Thanks.
I've got my woocommerce products auto reposting their links to social networks, but this should also work nicely/
 
Back
Top