Forum breadcrumbs – You are here:Asgaros Support ForumTips & TricksNotifications
Please or Register to create posts and topics.

Notifications

Hello,

I used this code :

$users = get_users();
foreach ($users as $user) {
update_user_meta($user->ID, ’asgarosforum_subscription_global_posts’, 1);
delete_user_meta($user->ID, ’asgarosforum_subscription_global_topics’);
But now I have too many users with the notifications activated.
Is it possible to remove the notifications for all of them and just put the notifications for the users in one group ?
Thank you for your help
Karine.
Quote from karine0908 on September 2, 2025, 9:18 am

Hello,

I used this code :

$users = get_users();
foreach ($users as $user) {
update_user_meta($user->ID, ’asgarosforum_subscription_global_posts’, 1);
delete_user_meta($user->ID, ’asgarosforum_subscription_global_topics’);
But now I have too many users with the notifications activated.
Is it possible to remove the notifications for all of them and just put the notifications for the users in one group ?
Thank you for your help
Karine.
Survival Race –  Link Quote Spam deleted

 

You need to delete the `asgarosforum_subscription_global_posts` user meta for all users, then add it back only for members of the specific group you want to notify.
– Delete notifications for all users:
$users = get_users();
foreach ($users as $user) {
delete_user_meta($user->ID, ‘asgarosforum_subscription_global_posts’);
}

– Re-enable Notifications for a Specific User Group:
$users_in_group = get_users(array(‘role’ => ‘your_user_group_name’));
foreach ($users_in_group as $user) {
update_user_meta($user->ID, ‘asgarosforum_subscription_global_posts’, 1);
}

Quote from karine0908 on September 2, 2025, 9:18 am

Hello,

I used this code :

$users = get_users();
foreach ($users as $user) {
update_user_meta($user->ID, ’asgarosforum_subscription_global_posts’, 1);
delete_user_meta($user->ID, ’asgarosforum_subscription_global_topics’);
But now I have too many users with the notifications activated.
Is it possible to remove the notifications for all of them and just put the notifications for the users in one group ?
Thank you for your help
Karine.driving games –  Link Quote Spam deleted

You can modify the $specific_group_user_ids array to include the IDs of the users she wants to have notifications. This approach ensures that all users have their notifications removed, and only the selected group receives them.