Title: Exclude Posts Newer Than&#8230;
Last modified: September 11, 2016

---

# Exclude Posts Newer Than…

 *  Resolved [mrlambdas](https://wordpress.org/support/users/mrlambdas/)
 * (@mrlambdas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/exclude-posts-newer-than/)
 * Is there a way to exclude posts newer than a a given date as in the published
   age of posts? I believe this is where it is being set in display-posts.php,
 *     ```
       // How old should the posts be?
       	if ( $args['how_old'] ) {
       		$where .= $wpdb->prepare( " AND $wpdb->posts.post_date > '%s' ", gmdate( 'Y-m-d H:m:s', $current_time - ( $args['how_old'] * DAY_IN_SECONDS ) ) );
       	}
       ```
   
 * To which I’ve tried adding the line
    `$where .= $wpdb->prepare( " AND $wpdb->
   posts.post_date > '%s' ", gmdate( 'Y-m-d H:m:s', $current_time - ( 2 * DAY_IN_SECONDS)));`
   unsuccessfully. Is there already a way that I have overlooked in the settings?
    -  This topic was modified 9 years, 8 months ago by [mrlambdas](https://wordpress.org/support/users/mrlambdas/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/exclude-posts-newer-than/#post-8170131)
 * Hi there!
 * Are you sure you posted at the right place? Those code snippets aren’t related
   to WPP.
 *  Thread Starter [mrlambdas](https://wordpress.org/support/users/mrlambdas/)
 * (@mrlambdas)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/exclude-posts-newer-than/#post-8171153)
 * You’re absolutely right, my apologies, wrong plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude Posts Newer Than…’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mrlambdas](https://wordpress.org/support/users/mrlambdas/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/exclude-posts-newer-than/#post-8171153)
 * Status: resolved