Title: mini widget guest
Last modified: July 7, 2026

---

# mini widget guest

 *  Resolved [pablito201](https://wordpress.org/support/users/pablito201/)
 * (@pablito201)
 * [1 week, 5 days ago](https://wordpress.org/support/topic/mini-widget-guest/)
 * Hello again. I want the guest chat feature to only work on the specified page
   and not in index.php, category.php, and single.php. How can I do this?

Viewing 1 replies (of 1 total)

 *  Plugin Support [Andrij Tkachenko](https://wordpress.org/support/users/andrijtkachenko/)
 * (@andrijtkachenko)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/mini-widget-guest/#post-18960331)
 * Hi,
 * There is no built-in option to limit the mini widget to specific pages yet, but
   you can do it with a small code snippet — add it to your child theme’s functions.
   php or via a code snippets plugin:
 *     ```wp-block-code
       add_action( 'wp', function () {    if ( is_user_logged_in() ) {        return;    }    if ( is_page( 'your-chat-page' ) ) {        return;    }    if ( function_exists( 'Better_Messages' ) && ! empty( Better_Messages()->mini_list ) ) {        remove_action( 'wp_footer', array( Better_Messages()->mini_list, 'html' ), 199 );    }    if ( function_exists( 'Better_Messages_Mini' ) ) {        remove_action( 'wp_footer', array( Better_Messages_Mini(), 'html' ), 200 );    }} );
       ```
   
 * Replace your-chat-page with the slug (or ID) of the page where the chat should
   stay. With this snippet the floating widget is shown to guests only on that page
   and removed everywhere else — including the blog index, category archives and
   single posts. Logged-in users are not affected; if you want the same restriction
   for everyone, remove the is_user_logged_in() check.
 * If you instead only want to hide it on the blog templates and keep it everywhere
   else, replace the is_page( … ) condition with:
 *     ```wp-block-code
       if ( ! ( is_home() || is_category() || is_single() ) ) {    return;}
       ```
   
 * Thanks!

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmini-widget-guest%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/bp-better-messages/assets/icon-256x256.png?rev=2835105)
 * [Better Messages - Chat Rooms, Group Chat, Private Messages & AI Chat Bots](https://wordpress.org/plugins/bp-better-messages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-better-messages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-better-messages/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-better-messages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-better-messages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-better-messages/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Andrij Tkachenko](https://wordpress.org/support/users/andrijtkachenko/)
 * Last activity: [1 week, 3 days ago](https://wordpress.org/support/topic/mini-widget-guest/#post-18960331)
 * Status: resolved