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,
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
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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();
})();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are my hero! I had 60+ pages of these to deal with. Much gratitude from a Confluence administrator...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's working !! I was 26 pages of pages... All removed in 1 minute. Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI @Stefan Ey
Does that work for Confluence Cloud too?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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(); })();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kirk Bratvold if I copy your script, the error "incorrect URL" appears. Any ideas on how to solve that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This saved me SO much time... I had 85 pages of topics to "unwatch". Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 :
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow, this solution was amazing, I had 40 pages topics to "unwatch". Very nice, Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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);})();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Mark Leci, it's worked for me (replacing the : after the leading javascript with : )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Thierry BLOCH Thank you! Replacing the "&colen" with just ":"worked like a charm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now that we have moved from the company server to the Atlassian cloud, the bookmarklet code no longer works in the cloud. Since an HTMLCollection is returned instead of an array when collecting the watches, iteration using forEach is no longer possible.
Thus I reworked the bookmarklet code:
javascript: void (function () {let links=document.getElementsByClassName('link-stop-watching'); for(i=0;i<links.length;i++){links[i].click();} setTimeout(() => location.reload(), 1000);})();
It should also work with the server version, but I can't test it anymore.
Good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My original posting does not help as you are on cloud sorry.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.