Stop watching all the pages in space

Ryota Hashimoto July 24, 2020

Hi,

I have a bunch of watching pages and want to stop all.  Is there a way for bulk execution of that, instead of opening each page and stop watching one by one?

Thanks,

5 answers

1 accepted

1 vote
Answer accepted
Sachin
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 24, 2020

Hello @Ryota Hashimoto , on top right corner --> Goto --> Profile --> Settings --> Watches --> From here you can click "Stop Watching" for any unwanted spaces or pages you like.

You can also adjust your email notification options from your email settings
https://yourinstancename/wiki/users/viewmyemailsettings.action page or goto --> your profile --> Settings --> Email --> Edit --> Turn off Autowatch

Ryota Hashimoto July 27, 2020

Hi Sachin thank you for your help. 

I found the Watches page and will stop them one by one since I'm still afraid there are no bulk way to do them at once. 

Also the autowatch info helped me while I need that feature in usual case but not applied on this case since I've made bunch of pages by add-on. 

Thanks, 

7 votes
Stefan Ey February 15, 2022

If you have many watches because you imported a lot of pages it is messy to stop all the watches step by step.

I wrote a simple bookmarklet so I can stop all watches on the page with just one click and the page will reload as well.

For example, if you have 30 watch pages, you only need 30 clicks to stop them all.

This is the js-code of the bookmarklet:

 

javascript: void (function () {

    document.getElementsByClassName('link-stop-watching').forEach(b => b.click());

    location.reload();

})();
Maria Murphy February 23, 2022

You are my hero!  I had 60+ pages of these to deal with.  Much gratitude from a Confluence administrator...

Like # people like this
Julian from AF March 30, 2022

Hi can you descrire how use this?? Thank you 

Stefan Ey March 30, 2022

Ask Google what a bookmarklet is and how to use it. The bookmarklet code is above.

Julian from AF April 6, 2022

It's working !! I was 26 pages of pages... All removed in 1 minute. Thank you 

Anja Zhuchkova April 21, 2022

HI @Stefan Ey 

Does that work for Confluence Cloud too? 

Stefan Ey April 21, 2022

I don't know - we are using the server version. But I think the frontend in the browser should be the same or very similar and it could work fine.

Brett Neilson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2022

This saved me a ton of time!   I had well over 200 pages that I was watching and within a few clicks that was resolved.

Kirk Bratvold
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2022

It didn't work for me using Chrome v106 and Confluence Cloud, until I changed it to this:

 

javascript: void (function () { const el=document.getElementsByClassName('link-stop-watching'); [...el].forEach(b => b.click()); location.reload(); })();

Anja Zhuchkova November 17, 2022

@Kirk Bratvold if I copy your script, the error "incorrect URL" appears. Any ideas on how to solve that?

Kimberly Onnen January 5, 2023

This saved me SO much time... I had 85 pages of topics to "unwatch". Thank you!

Warren S
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 1, 2023

This was a life saver, the refresh action didn't work for me on Chrome v109.0.5414.75, but a click and an F5 did the trick. A few minutes later Im watch free. Thanks again!

Stefan Ey February 2, 2023

I wrote a little HTML test file and I have discovered that the page reload was faster than the execution of the simulated clicks on the «Stop Watching» buttons.

I have improved the bookmarklet code. Here is the new version that works fine on my Confluence profile. If needed you can increase the timeout value - here 2000.

Happy coding or working ;-)

javascript:(function () {
document.getElementsByClassName('link-stop-watching').forEach(b => b.click());
setTimeout(() => location.reload(), 2000);
})();

Due the code box above works not well, you have to replace the : after the leading javascript with : 

Like efavreau likes this
Danilo Castro Borges
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 31, 2023

Wow, this solution was amazing, I had 40 pages topics to "unwatch".  Very nice, Thank you!

Mark Leci
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 19, 2023

I got an error using all the previous examples  -  here's a bookmarklet that worked for me with Confluence Cloud from the wiki/users/viewnotifications.action page. I also reduced the reload time because I had 45 pages of links to click! 

 

javascript:window.onload=(function () {const elementAr = document.getElementsByClassName('link-stop-watching');const Ar = Array.from(elementAr);Ar.forEach(b => {b.click()});setTimeout(() => location.reload(), 500);})();

Like # people like this
Stefan Ey June 20, 2023

You mean you lose precious 45 x 2 seconds = 1.5 minutes of your lifetime? What will you do with the saved minute? It's a free world ;-)

Thierry BLOCH June 21, 2023

Thank you Mark Leci, it's worked for me (replacing the : after the leading javascript with : )

Like Arnaud Boyer likes this
M Hoogenboom March 7, 2024

This is brilliant. Many thanks for this.

2 votes
Matt C_ Wilson February 19, 2024

Here is a boosted version of the script that allows you to target only a particular space.

In my case, my role changed at my company such that I handed off ownership of a space I'd maintained for a long time and authored hundreds of pages in.

I wanted to stop watching every single one of that space's pages, but keep my other watches.

The way this script works:

The code below builds a function called "go" that takes two parameters:

  1. specific "searchText" for the space name(s) to match
  2. a "live" boolean that must be set "true" for the function to auto-click links. 

So, leaving the "live" parameter out or setting it "false" lets you check what would be done without doing it.

function go(searchText, live) {
var ixs = [];
var logmsg = "would stop: ";

if (live) {
logmsg = "stopping: ";
}

var spans = $("#page-watches tr td span.smalltext");
spans.each((k, v) => { if (v.textContent.includes(searchText)) { ixs.push(k) } } );

console.log(ixs.join(", "));

var as = $("#page-watches tr td.tableview-action-icon div a:not('.hidden')");

console.log(as.length);

as.each((k, v) => { if (ixs[0] == k) { ixs.shift(); if (v.classList.contains("link-stop-watching")) { console.log(logmsg + k); if (live) { v.click(); } } } } );

if (live) { setTimeout(() => location.reload(), 2000); }
}

So, for example, if you want to bulk unwatch all pages for spaces with "Foo" in their name, you would first paste the above function into your browser console, and then run:

go("Foo");   // shows you which links it would click using their index position

go("Foo", true); // clicks those particular stop watching links, ignores others

 

Note: you will need to re-paste the function after the page reloads.  You may also run into a point where all 20 links on the Watches page you are on are not hits.  In that case, you will need to manually navigate to the next page, paste, and run again.

Stefan Ey February 20, 2024

Inspired by your post I have rewritten my bookmarklet code, thus only watches of a specific space are removed. The user is asked for the space name, which is temporarily stored until the last page is processed by executing this bookmarklet.

javascript: void (function () {   
    var tbl = document.getElementById('page-watches');
    var tblRows = tbl.tBodies[0].rows;
    var rowsCount = tblRows.length;
var itemName = 'watchSpacePattern';

    if(rowsCount > 0) {       
        var spacePattern = localStorage.getItem(itemName);
        if (spacePattern == undefined) {
            spacePattern = '(' + prompt('Enter the space name for which you want to delete the watches.') + ')';
            localStorage.setItem(itemName, spacePattern);
        }
        tblRows.forEach(rw => {
            var spaceName = rw.cells[0].children[2].textContent;
            if (spaceName == spacePattern) {
                rw.cells[1].children[0].children.forEach(ch => {
                    if(ch.textContent == 'Stop Watching'){
                        ch.click();
                    }
                })
            }
        });    
        if(rowsCount < 20) {
            localStorage.removeItem(itemName);
        }
        setTimeout(() => location.reload(), 1000);    
    } else {
        localStorage.removeItem(itemName);
    }
})();

Happy coding ;-)

Like efavreau likes this
0 votes
efavreau July 17, 2023

I wrote this up a while ago (February 3, 2022), borrowing from a deleted user, and I still use it. I know a couple other people told me it worked for them too.

It will help with:
 * Watched pages
 * Watched spaces
 * Save for Later
 * Drafts

https://community.atlassian.com/t5/Confluence-discussions/Bulk-removing-your-Watched-pages-spaces-Save-for-Later-and/td-p/1933623

0 votes
Andreas Purde
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 26, 2020

My original posting does not help as you are on cloud sorry.

Ryota Hashimoto October 7, 2021

np thanks a lot!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events