Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bulk Unwatch pages?

Is there any way to bulk unwatch pages in Confluence? With the new autowatch feature, users end up watching potentially hundreds of pages. It's extremely tedious to individually unwatch these pages. How can we remove all watches at once or selectively in bulk?

9 answers

2 accepted

22 votes
Answer accepted
Deleted user Oct 21, 2014

If you have no access to the DB one could use the browser's JavaScript console

$(function(){
  $('.link-stop-watching').click();
  setTimeout(function(){location.reload();},2000);
});

With this you can at least remove all watches that are shown on the watches page. No fun if you have 110 pages of watches (like me), but better than clicking every "Stop Watching" link by hand laugh

Hi,

Should we be placing the above code on the parent page??

Regards,

Rohit

Get to the page, open up web inspect (chrome) and paste the code into the Script tab.

Like Nastja K likes this

seems to have worked

Worked for me as well, but the Scripts tab no longer exists in the current version of Chrome and is now called Sources.

  1. In Chrome, right-click the page and select Inspect.
  2. At the top select the Source tab.
  3. At the very bottom section, select the Console tab instead of What's New.
  4. In the text field below that at the bottom to the right of the ">" paste in the code and hit enter.
    • $(function(){
        $('.link-stop-watching').click();
        setTimeout(function(){location.reload();},2000);
      });
  5. All listed watches will switch from Stop Watching to Start Watching, then the page will auto-refresh to display the next page of watches. Note that the number of pages reduced.
  6. Repeat step 4 until all pages that contain watches are removed.

Mind you, it's not a 100% bulk removal, but a bulk removal per page. It's less tedious than unwatching one-by-one. Repeating step 4 is really a matter of hitting the paste shortcut keys, enter and let it refresh, paste shortcut keys, enter and let it refresh, etc.

Like # people like this

We were facing the same problem. What we finally did was dropping the entries in the NOTIFICATIONS table in our database. It looked something like this since we only had to drop the notifications of the person who had initially created the Confluence layout.

DELETE FROM NOTIFICATIONS WHERE username = '<user's name>';

After that we experienced a problem that the user the user got an exception when he first tried to view his watches. After watching a random page everything was fine. I don't know if this is the "correct" way but I was looking everywhere before we decided to apply changes directly to the database.

By the way, we globally unchecked the "autowatch" feature:

Workaround

The config lives in an XML file: <confluence install>/confluence/WEB-INF/lib/confluence-x.x.x.jar/preferences-default.xml.

You need to change the boolean value to false, thus:

<preference type="Boolean">
       <name>confluence.prefs.watch.my.own.content</name>
       <value>false</value>
   </preference>

Then place it as <confluence install>/confluence/WEB-INF/classes/preferences-default.xml and restart Confluence.

For more details on modifying jarred config files, please refer to this doc: http://confluence.atlassian.com/display/DOC/Editing+Files+within+JAR+Archives

Hope this works for you

Cheers

Christian

Christian,

Thank you for your response and tips. That's what I was afraid of...

Shawn

For all the administrators suffering from this problem, I have written a pair of user macros to fit two use cases:

1. Removing a set of watchers from a set of child pages (and re-adding them, in the case of a temporary change, like moving a bunch of pages).

2. Removing watches for a particular user (or yourself) filtered by space (also with the option to re-add).

You can choose the pages you want from a list of checkboxes, so you can choose as many or as few as you would like.

Note that you must be running an installed version of Confluence (now known as Confluence Server) and have "Remote API" (under General Configuration) enabled.

They should be compatible back to Confluence 4.0, although I haven't been able to test it exhaustively.

You can find the user macros here:

https://bitbucket.org/stephendeutsch/confluence-user-macros/src

Navigate to "bulk remove watchers" and you can find the two macros. "remove watchers" is for use case #1, and "remove watches for user" is for use case #2.

Simply give them a name in the user macro browser (you probably want to select the option "Visible only to system administrators in the Macro Browser"), embed them in a page, and you are all set to go! Using them is pretty self-explanatory.

If you have any questions, you can e-mail me at stephen.deutsch@zanox.com, but I can't offer full support, so please use it at your own risk.

Perhaps this will motivate Atlassian to implement some sort of solution themselves...

This JavaScript worked for me on Confluence 5.6.6

$(function(){
 $('a.link-stop-watching').click();
 setTimeout(function(){location.reload();},2000);
});
1 vote

You may also want to watch/comment/vote on this issue to stay updated: https://jira.atlassian.com/browse/CONF-8458

Deleted user Feb 28, 2018

thanks that is so far the best solution 

Working great and it's free! Also, user can do it themselves.

Hi all, there is a workaround using the free descendant notification plugin of adaptivist, which removes all watches fo a space, see https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.descendentNotification/versions#b302

- Activate watching the page family on root page of a space (will temporarily set you as watcher on all pages of this space)

- Edit page family watches (on the root page or in your personal settings)

- Choose Remove root and all watches on child pages in the page family management page

Don't be too quick in doing this in large spaces. The plugin just does a bulk add or bulk remove on all the pages, which takes a while to finish.

At least that helped me removing my ~ 3800 watches in about 30 minutes.

Good luck.

Matin

P.S.: And don't forget to dump your trashes, might decimate your watchlist too

The javascript posted By StAn above didn't work for me on Confluence 4.3. But this did:

$(function(){
$('a.icon.icon-stop-watching').click();
setTimeout(function(){location.reload();},2000);
});

Thanks for the tip!

Do this for each space you want to apply the change:

  • Click "Overview" on the top left
  • Click the watch button (the eye icon on the top right)
  • Uncheck "Watch all content in this space"

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

146 views 0 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you