Support » Theme: P2 » Need a setting to turn off mentionData

  • Resolved .sarah.


    Blogs with many (normally spam) users fall over on the mentionData line in js.php.

    It would be great to have a setting to make mentionData an option. In the meantime I’ve hardcoded it out with PHP comments.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Kathryn


    Automattic Happiness Engineer

    Thanks for the idea. I will suggest this enhancement to our developers to see if it’s something they’d consider for a future version of the theme.

    Have you tried looking into a plugin to prevent all the spam registrations? Could be another way to tackle the issue.

    You can try a filter to return only the relevant users — the ones on latest posts and comments. I tried it and at least i could solve the mentionData size.

    Moderator Kathryn


    Automattic Happiness Engineer

    Sarah – I just wanted to let you know that our developers said that making mentionData an option isn’t a feature that’s going to be added at this stage, since development efforts are currently going into the next generation of p2.

    If you’d like to be notified when it’s available or are interested in beta testing, feel free to sign up here:

    Get Oxygenated

    Thanks again for the feedback.

    Thanks Kathryn

    There’s always a cutoff when a new version gets started and I appreciate your comment.

    .Sarah could you show me (I am no coder) the way to filter off the mentiondata : ” In the meantime I’ve hardcoded it out with PHP comments.”

    Sure thing joeymalek, it’s not where you’d think it might be!

    open up wp-content/themes/p2/inc/js.php

    find line 250

    there are a whole stack of javascript variables being created and line 250 should read

    var mentionData = <?php echo json_encode($mentions->user_suggestion());

    I changed that to

    /* var mentionData = <?php echo json_encode($mentions->user_suggestion()); */
    var mentionData = false;

    The variable needs to be declared otherwise other scripts break, but false means there is no longer an overhead and your site will work. Visible if you view source over at

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need a setting to turn off mentionData’ is closed to new replies.