Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a fair amount of content in wordpress pages that gradually gets out of date over time. I can have an 'offline' process to set reminders in my calendar to remind me to review particular pages and bring them up to date.

However I was wondering if there is a way (with a plugin perhaps) to have WordPress put the pages into a 'needs review' state a certain amount of time after it was last edited. This would keep the page live, but prompts me to review the content.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I tend to look for simple solutions so my suggestion is to query pages, sort by modified day and display in Dashboard widget.

add_action( 'wp_dashboard_setup', 'add_old_pages_widget' );

function add_old_pages_widget() {

    wp_add_dashboard_widget( 'oldpages', 'Oldest Pages', 'old_pages' );
}

function old_pages() {

    $pages = get_pages( array(
    'sort_column' => 'post_modified'
    ) );

    echo '<ul>';

    foreach ( $pages  as $page) {

    $edited = human_time_diff( strtotime($page->post_modified) );
    $link = get_edit_post_link( $page->ID );
    echo "<li><a href='{$link}'>{$page->post_title}</a> ( edited {$edited} ago )</li>";
    }

    echo '</ul>';
}

Can be modified to hide if no pages old enough, etc, etc.

share|improve this answer
    
Thanks - I'll give that a try tonight and will accept if it does the job for me - haven't played with dashboard widgets before –  Kris C Sep 22 '10 at 9:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.