Title: Modify &#8220;Popularity Contest&#8221; plugin
Last modified: August 19, 2016

---

# Modify “Popularity Contest” plugin

 *  [kirkward](https://wordpress.org/support/users/kirkward/)
 * (@kirkward)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/)
 * I am using the “Popularity Contest” plugin along with the “Exclude Pages from
   Navigation” plugin. Both are working well, as designed.
 * However, the popularity contest measures and displays pages in it that I have
   designated to be omitted from the navigation through the exclude from navigation
   plugin.
 * Can someone instruct me on a way to remove either specific pages, or groups of
   pages from display by the popularity contest functions?
 * Thanks in advance,
    Kirk Ward

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

 *  [t3hhu1k](https://wordpress.org/support/users/t3hhu1k/)
 * (@t3hhu1k)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/#post-996784)
 * I’ve been looking for an answer to this, too. :/
 *  [Zack Katz](https://wordpress.org/support/users/katzwebdesign/)
 * (@katzwebdesign)
 * [17 years ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/#post-996796)
 * You need to edit popularity-contest.php like this:
 * Around line 1383, there is the following code:
 *     ```
       WHERE post_status = 'publish'
       ```
   
 * add AFTER it:
 *     ```
       AND post_type = 'post'
       ```
   
 * It should look like this in the end:
 *     ```
       WHERE post_status = 'publish'
       AND post_type = 'post'
       AND post_date < NOW()
       ```
   
 *  [jbiesnecker](https://wordpress.org/support/users/jbiesnecker/)
 * (@jbiesnecker)
 * [16 years, 10 months ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/#post-996804)
 * Hacking on the plugin code isn’t a particularly good idea (for instance, when
   you upgrade you have to port all of your changes to the new version).
 * Popularity Contest supports filters, so you can define behavior like that outside
   of the plugin. To get rid of pages in almost all functions (which is, I think
   the behavior most people want) you can add:
 *     ```
       add_filter('posts_where', 'limit_pc_posts', 10, 0);
       function limit_pc_posts() {
       	return " AND post_type = 'post' ";
       }
       ```
   
 * somewhere in your template (I normally include a custom PHP file in all of my
   themes so I can add/remove things like this.
 * HTH
 *  [maxoud](https://wordpress.org/support/users/maxoud/)
 * (@maxoud)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/#post-996822)
 * The code from **jbiesnecker** breaks the whole blog on 2.8.6. May be because 
   of custom queries I use?

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

The topic ‘Modify “Popularity Contest” plugin’ is closed to new replies.

## Tags

 * [exclude pages from navigation](https://wordpress.org/support/topic-tag/exclude-pages-from-navigation/)
 * [Hide pages](https://wordpress.org/support/topic-tag/hide-pages/)

 * 4 replies
 * 5 participants
 * Last reply from: [maxoud](https://wordpress.org/support/users/maxoud/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/modify-popularity-contest-plugin/#post-996822)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
