Bulk removing your Watched pages/spaces, Save for Later, and Drafts

efavreau February 3, 2022

Reviewing my Atlassian Confluence profile within our enterprise install, I see a lot of detritus out there. Years worth of watched pages, watched spaces, Save for Later, and Drafts. Looking for a solution to any of it, I found code from 2014 on this page from a deleted user: https://community.atlassian.com/t5/Confluence-questions/Bulk-Unwatch-pages/qaq-p/248164

That idea was the nudge I needed to help me create additional derivative snippets, and package it all together in one post, in hopes of helping others.

Environment:
All snippets were successfully ran on Atlassian Confluence 7.4 Enterprise

Tools:
Your browser's Developer Tools console

Directions:

  1. In your web browser of choice, open the Developer Tools and get to the "Console" (Use a DuckDuckGo search if you can't find it)
  2. In the console, near the ">>" or ">" (depending on browser), paste in the code and hit enter.
  3. Repeat as often as needed.

What each code does:

The code uses the class of the hyperlink to click matching links for the user, and then a reload of the page, which displays the next page of items. Note that the number of pages is now reduced by one.

It is not a one-click solution, but it is much faster than clicking one at a time. >10k items that were out there for years, were cleaned up in minutes. Good luck!

Disclaimer:

Mostly likely you have no reason to trust me or my writing (or anyone else's writing, etc.). So don't. Don't use these code snippets or any code anywhere if you don't understand it. If you use it, it's on you. Test. YMMV.

Bulk Remove Confluence Watches

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

Bulk Remove Confluence "Save for Later"

$(function(){
$('.aui-iconfont-star-filled').click();
setTimeout(function(){location.reload();},2000);
});

Bulk Remove Confluence Drafts

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

 

If anyone can level this up, PLEASE DO! Improvements, alternatives, etc., are welcome!

1 answer

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events