Title: Hide Visited Notifications
Last modified: November 21, 2021

---

# Hide Visited Notifications

 *  Resolved [meir321](https://wordpress.org/support/users/meir321/)
 * (@meir321)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/)
 * Hi, I’m currently hiding visited Notifications using a custom ID and then targeting
   with CSS:
 *     ```
       #notify_visit {
         display: none;
       }
       ```
   
 * The issue with this is, that when everything is visited the box is empty when
   clicked and it doesn’t display the “Empty notification box text”
 * Please advise if there is a better way to do this.
    Thank you

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

 *  Plugin Author [wpdever](https://wordpress.org/support/users/wpdever/)
 * (@wpdever)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/#post-15090140)
 * Hi,
 * Which type of notifications would you like to hide? If it’s notifications created
   manually, posts or cpts notifications, you can use this filter hook in your theme’s
   functions.php file: wnbell_notification_conditions to exclude seen notifications.
 * If it’s user notifications, you can delete seen notifications by adding this 
   to your theme’s functions.php:
 * add_action(‘wnbell_add_unseen’, ‘delete_seen_callback’,11,1);
    function delete_seen_callback(
   $notification_id){ $current_user_id = get_current_user_id(); $user_meta_field
   = ‘wnbell_unseen_comments’; $unseen_array = get_user_meta($current_user_id, $
   user_meta_field, true); if (!$unseen_array) { $unseen_array=array(); } foreach(
   $unseen_array as $key=>$notification){ if($notification[‘type’]===’cfc’ && $notification[‘
   comment_id’]==$notification_id){ //unset unset($unseen_array[$key]); } } update_user_meta(
   $current_user_id, ‘wnbell_unseen_comments’, $unseen_array);
 *  }
 * This applies only to comment replies notifications, it needs slight changes for
   the other user notifications so let me know which type of notifications you’re
   using.
 *  Thread Starter [meir321](https://wordpress.org/support/users/meir321/)
 * (@meir321)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/#post-15090144)
 * Hi, thanks for your reply. My question is regarding notifications created automatically
   from posts and custom post types and notifications created manually by adding
   a notification.
 * Thank you
 *  Plugin Author [wpdever](https://wordpress.org/support/users/wpdever/)
 * (@wpdever)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/#post-15090167)
 * Hi, in that case, you can try this in your theme’s functions.php file (or in 
   a custom plugin):
 *     ```
       add_filter("wnbell_notification_conditions", "add_notification_conditions");
       function add_notification_conditions()
       {
           $condition = "";
           $current_user_id = get_current_user_id();
   
           $seen_posts = get_user_meta($current_user_id, 'wnbell_seen_notification_post', true);
           if (!$seen_posts) {
               return $condition;
           }
           $condition = "AND posts.ID NOT IN(" . wnbell_escape_array($seen_posts) . ")";
   
           return $condition;
       }
       ```
   
 *  Thread Starter [meir321](https://wordpress.org/support/users/meir321/)
 * (@meir321)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/#post-15090182)
 * Thank You!

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

The topic ‘Hide Visited Notifications’ is closed to new replies.

 * ![](https://ps.w.org/wp-notification-bell/assets/icon-256x256.png?rev=2439614)
 * [WP Notification Bell](https://wordpress.org/plugins/wp-notification-bell/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-notification-bell/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-notification-bell/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-notification-bell/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-notification-bell/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [meir321](https://wordpress.org/support/users/meir321/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/hide-visited-notifications/#post-15090182)
 * Status: resolved