1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Hack] Wordpress Date Hacks - Cheat Google Freshness SEO

Discussion in 'Black Hat SEO' started by TheTK, Sep 1, 2013.

  1. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    [​IMG]

    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:


    [​IMG]


    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:


    [​IMG]


    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!


    [​IMG]
    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]


    [​IMG]


    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:


    [​IMG]


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


    [​IMG]


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


    Download Free: Dynamic Date Plugin - Note, not my plugin original WSO is here


    and you can find the instructions here


    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!


    [​IMG]


    This next method is also a plugin (and an awesome open source one) that I highly recommend. It's called 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!


    [​IMG]


    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 Google Sitemaps for Video Plugin 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.


    [​IMG]

    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 Thanks x 21
  2. ula36

    ula36 Registered Member

    Joined:
    Nov 28, 2008
    Messages:
    58
    Likes Received:
    51
    Thanks for this post. I've heard about how Google emphazises on freshness and the WSO plugin will come in handy.
     
  3. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Premium Member

    Joined:
    Nov 10, 2012
    Messages:
    10,115
    Likes Received:
    28,553
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
  4. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    Thanks!

    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!
     
    • Thanks Thanks x 1
  5. thetraveller

    thetraveller Senior Member

    Joined:
    Mar 9, 2009
    Messages:
    1,121
    Likes Received:
    686
    Occupation:
    thousandsmouseclicks
    Location:
    Eastern Europe
    You revived my old blogs. Thanks +rep given!
     
  6. krishnacode360

    krishnacode360 Power Member

    Joined:
    May 30, 2012
    Messages:
    669
    Likes Received:
    187
    Oh really useful post . i will try the dynamic plugin on my blog now. Thank you
     
  7. TheLinkGuy

    TheLinkGuy Power Member

    Joined:
    Nov 20, 2010
    Messages:
    627
    Likes Received:
    128
    Location:
    EU
    Holy heck mate I came on here to look for this thank you so much!
     
  8. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    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!
     
  9. TropicalSun

    TropicalSun Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    258
    Likes Received:
    34
    Occupation:
    Perpetual innovator
    NICE SHARE!

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

    gullsinn Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 24, 2009
    Messages:
    2,429
    Likes Received:
    2,210
    Gender:
    Male
    Occupation:
    Jobless :D
    Location:
    Graveyard
    Home Page:
    Yes, this is a worth share you deserve rep+ because I know most of people don't know about it.
     
  11. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    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.

    true indeed! Not a common method! Thanks for the rep!
     
  12. royserpa

    royserpa Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2011
    Messages:
    4,646
    Likes Received:
    3,492
    Gender:
    Male
    Occupation:
    Negative Options aka Rebills!
    Location:
    Royserpa
    Home Page:
    Lol i thought this was common sense ^^
    Anyway, good share!
     
  13. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    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
     
  14. royserpa

    royserpa Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2011
    Messages:
    4,646
    Likes Received:
    3,492
    Gender:
    Male
    Occupation:
    Negative Options aka Rebills!
    Location:
    Royserpa
    Home Page:
    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
     
  15. london710

    london710 Newbie

    Joined:
    Mar 23, 2012
    Messages:
    42
    Likes Received:
    6
    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!
     
  16. TheTK

    TheTK Registered Member

    Joined:
    Aug 12, 2013
    Messages:
    58
    Likes Received:
    93
    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.
     
  17. Riders On The Storm

    Riders On The Storm Senior Member

    Joined:
    Feb 27, 2012
    Messages:
    1,150
    Likes Received:
    489
    Thanks for the nice share. The download file is missing though. Can you re-up?
     
  18. jaksana03

    jaksana03 Jr. VIP Jr. VIP Premium Member

    Joined:
    Dec 10, 2010
    Messages:
    1,386
    Likes Received:
    449
    it this method works?

    I mean does it help in ranking?

    please reply.
    thanks
     
  19. Asif WILSON Khan

    Asif WILSON Khan Executive VIP Premium Member

    Joined:
    Nov 10, 2012
    Messages:
    10,115
    Likes Received:
    28,553
    Gender:
    Male
    Occupation:
    Fun Lovin' Criminal
    Location:
    London
    Home Page:
    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_eventtime()+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($fhstrftime("%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

    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.
     
  20. hes21

    hes21 Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 11, 2013
    Messages:
    214
    Likes Received:
    49
    Thanks.
    I've got my woocommerce products auto reposting their links to social networks, but this should also work nicely/