WordPress Popular Posts
[resolved] [Plugin: WordPress Popular Posts] Can we NOT use POST (to admin-ajax.php) for static homepage!! (4 posts)

  1. Jerome
    Posted 4 years ago #

    Hi. I'd like to know, if we're using a static page created in the Pages menu in wp-admin as our blog's homepage, can we NOT post that pageview to the database every time the homepage is called? The POST to and reply from admin-ajax.php is taking over 4 seconds on my server, which is highly delaying my pageloads. So, is there a way that I can immediately stop this POST from happening on my homepage only? That's going to be the deciding factor of whether I keep using this plugin or not, and after all the work I put into trying to figure the code out for it, I would REALLY hate to have to find another plugin. Please help. Thanks!


  2. Jerome
    Posted 4 years ago #

    Hey Dev, can ya answer me?

  3. Hector Cabrera
    Plugin Author

    Posted 4 years ago #

    Hi Jerome,

    That's something I didn't think of before. Try this:

    # Open wordpress-popular-posts.php using an editor such as Notepad or Dreamweaver.
    # Find this:

    // if we're on a page or post, load the script
    if ( (is_single() || is_page()) && !is_user_logged_in() ) {

    # ... and change it to:

    // if we're on a page or post, load the script
    if ( (is_single() || is_page()) && !is_user_logged_in() && !is_front_page() ) {

    # Save changes.

  4. Jerome
    Posted 4 years ago #

    Thanks! this removed 2 seconds off each home-pageload!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic