Mass unsubscribe from space notifications in confluence
Asked by Bryan Collick:

I recently instituted confluence as the primary tool for documentation and collaboration at our company. To jumpstart usage, I created a couple dozen spaces for teams to develop. Somehow, that has turned into email notifications for virtually every edit in our confluence instance, which I do not want.

I know that each email I receive has an unsubscribe link, and I also know that there is a (very long) list of page watches in my personal settings. I'm wondering if there's a better solution to unsubscribe from these hundreds of pages. I'm currently only subscribed to my personal space, so i see no other big levers to pull.


Answers:
author: Jakub Pierzcha?a
body: Hi Bryan,

It is not possible to unwatch all pages with a single click out of the box.

There is a free plugin-in however that allows to do so:

<https://marketplace.atlassian.com/plugins/it.logontec.dev.watchremover/server/overview>


author: Anton Kulikov
body: if you have scriptrunner

this code help me

    import com.atlassian.confluence.mail.notification.NotificationManager
    import com.atlassian.spring.container.ContainerManager
    import com.atlassian.sal.api.component.ComponentLocator
    import com.atlassian.confluence.pages.PageManager
    import com.atlassian.confluence.search.service.ContentTypeEnum
    import org.slf4j.Logger
    import org.slf4j.LoggerFactory
    import com.atlassian.confluence.user.UserAccessor
    import com.atlassian.confluence.spaces.SpaceManager
    import com.atlassian.user.UserManager?
    Logger log = LoggerFactory.getLogger("console")?

    def userManager = ComponentLocator.getComponent(UserManager)
    NotificationManager nm = ( NotificationManager) ContainerManager.getComponent("notificationManager")
    PageManager pageManager = ComponentLocator.getComponent(PageManager)
    ContentTypeEnum ctp = ComponentLocator.getComponent(ContentTypeEnum)
    UserAccessor userAccessor = ComponentLocator.getComponent(UserAccessor)
    def spaceManager = ComponentLocator.getComponent(SpaceManager)
    def users = userManager.users.find{it.getName() == "username"} 
    def nfu = nm.getNotificationsByUser(userAccessor.getUserByName(users?.getName()))
    nm.removeAllNotificationsForUser(userAccessor.getUserByName(users.getName()))
    return? nm.getNotificationsByUser(userAccessor.getUserByName(users.getName()))


author: veton
body: Its not a solution yet, but rather a smarter workaround to clicking on every single "Stop Watching":

1. Go to Profile \> Watches (i.e. <https://confluence.YourCompany.net/users/viewnotifications.action>)
2. Open browser Developer Tools (F12)
3. Run this script:  
   $('.link-stop-watching').click()
4. Refresh the page and repeat until all watches are gone.

comments: author: Bryan Collick
body: clever!


author: Amal Edirisinghe
body: This is worked for me. Thanks for sharing.


author: Jakub Pierzcha?a
body: Hi Bryan

You could go to your profile settings and unsubscribe from there (it is called watching).

More info here: <https://confluence.atlassian.com/doc/watch-pages-spaces-and-blogs-139579.html>

"Manage watches from your user profile"[](https://confluence.atlassian.com/doc/watch-pages-spaces-and-blogs-139579.html)

comments: author: Bryan Collick
body: Hi Jakub, Thanks for your answer!

I know there is a list of page watches in my profile settings; I said that in my original comment. I currently have a long list of hundreds of pages I'm somehow watching. Do I have to click "stop watching" for each one?


author: Bryan Collick
body: Additionally, it seems like I'm getting added to pages that are **being** **created**. How do I stop that so that the list of pages I'm watching doesn't continue to grow?


author: Bryan Collick
body: Thanks Jakub! If you want to convert your comment to an answer, I'll use it to answer this question.


author: Jakub Pierzcha?a
body: Converted


Tags: notification