WPRentals Theme Documentation WPRentals Theme Documentation

  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API
Home / Technical how to / Technical – Reset Counter Inbox

Technical – Reset Counter Inbox

3818 views

This help explains how to reset the unread messages counter shown in the WPRentals user dashboard Inbox for an affected user account.

Content

  • What the Inbox counter is
  • When to use this reset
  • Normal way to clear unread messages
  • Technical reset by code
  • Confirm the counter was reset
  • Important notes
  • Related help

What the Inbox Counter Is

The unread messages counter from the user dashboard Inbox is saved as user meta.

The user meta key is:

unread_mess

Because this value is saved in the database for each user account, clearing browser cache or WPRentals cache will not reset it.

When to Use This Reset

Use this reset only if one user account still shows unread messages, but the Inbox does not have unread messages anymore.

Example:

  • The dashboard shows 5 unread messages.
  • The user opens the Inbox.
  • There are no unread messages left.
  • The counter remains stuck.

Normal Way to Clear Unread Messages

Unread messages are normally cleared when the user opens and reads the messages directly from the Inbox.

My Inbox

When messages are deleted without being read, the counter is still not updated. To clear it, use the technical reset below.

Technical Reset by Code

Before making any file change, create a full website backup.

Edit this file:

wp-content/themes/wprentals/user_dashboard_inbox.php

Add this code temporarily, as shown in the screenshot:

update_user_meta($userID,'unread_mess',0);

Then open the dashboard Inbox for the affected user account.

This code resets the counter only for the user account that loads the Inbox page.

Important: This does not reset all users at once. The code uses $userID, which is the current user loading the Inbox page.

Confirm the Counter Was Reset

After adding the temporary code:

  1. Open the affected user account.
  2. Go to the user dashboard Inbox.
  3. Check that the unread counter is reset.
  4. Remove the code from the file.
  5. Save the file again.
Important: Do not leave this code active. It forces the unread counter to 0 every time the Inbox page is loaded by a user.

Important Notes

  • This is a technical reset for a stuck unread messages counter.
  • The counter is stored as user meta, so cache clearing will not reset it.
  • The normal way to clear unread messages is to read the messages from the Inbox.
  • The temporary code resets only the user account that opens the Inbox page.
  • The code must be removed after the counter is reset.
  • Editing theme files is a custom technical change and can be overwritten by theme updates.
  • Always make a full backup before changing theme files.

Related Help

  • My Inbox
Technical how to

Related Articles

  • How to Make a Contact Button Open WhatsApp
  • How to add a new currency in Theme Options for payments.
  • How to Disable WordPress Image Compression and Preserve Original Quality
  • How to Change the Default Categories Icon from Listing Card Unit

HELP CATEGORIES

  • 61. General
  • 72. Installation & Basic Setup
  • 373. How Booking Works
  • 18Advanced Search
  • 17Elementor WPRentals Studio
  • 14Email Notifications
  • 27FAQ
  • 14Installation FAQ
  • 10Menu Options
  • 33Owner & Renter
  • 8Page Templates
  • 24Property / Listing
  • 22Shortcodes
  • 4Supported Maps
  • 99Technical how to
  • 5Third Party plugins
  • 4Translation & Multi Languages
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 12WP Rentals Payments
  • 80WP Rentals Theme Options
  • 26WPML & Weglot

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API