You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
k s.4
10 years agoNew member | Level 1
remove all shared links
Hi, I have many links in the links-list. Way to many. I take it that the files linked are accessible for anyone with the link. I want all these links removed with one command. It is too many to do it manually for each one.
Thanks
Please be careful as it will delete all your shared links! You have been warned! Works in Chrome (61.0.3163.100) maybe firefox and internet explorer but no links to test =) Open the browser's console window (right click anywhere and select inspect or control+shift+i) while in the shared links page. Paste the following code in the console command line, click enter and it will delete all shared links.
Due to secure http loading jquery (as suggested by other post) does not work, so this option is fine with vanilla javascript. The script below simulates consecutive mouse clicks: 1. click the three dot button next to the link, 2. click the delete link button in the drop down, 3. click the delete link buttin in the pop up dialog box. Note that it will take a minute to execute all those but in the end the list shall be clear. Hope it save you some trouble... and again be careful
for( var index = 0; index < 1000; index++ )
{
var dots = document.getElementById("bubbleDropdownTarget-" + index );
if( dots == undefined ) continue;
dots.click( );
document.getElementsByClassName( "bubble-menu-item" )[0].click( );
document.getElementsByClassName( "button-primary dbmodal-button" )[0].click( );
}
- visgeanExplorer | Level 3
If anyone is looking for solution in 2024: use the HTTP API. I made few scripts here: https://github.com/Visgean/check-dropbox-links/
- ripknoxxNew member | Level 2
Anyone know a way to delete all links at once. I've already tried the chrome java method and it doesn't work at all. Anyone have any other suggestions. This is confusing as to why they don't have it yet.
- ProblemSolvedNew member | Level 2
In a previous episode I managed to remove all of my shared links using a small javascript pasted in the browser's console. You can find the previous solution by using the link https://www.dropboxforum.com/t5/Create-upload-and-share/remove-all-shared-links/td-p/75611 (or by searching for "remove all shared links"). I tried today to use that script but the web design has changed since 2017 so the script did not work. Here is an update below. Hope it helps. Again exercise caution etc...
for( let dots of document.getElementsByClassName("mc-button") ) { dots.click( ); for( let del of document.getElementsByClassName("delete-link")) { del.click(); for( let can of document.getElementsByClassName("dbmodal-button") ) { can.click( ); break; } break; } break; }
Note that I have one extra "break;" in the end of the script, to remove only the first link, for testing etc. To unleash batch removal, just delete it.
- Defender9408New member | Level 2
Hi everyone, there have been several posts with solutions to deleting Dropbox Shared Links (https://www.dropbox.com/share/links) in bulk. The most recent being this post above from August 2022.
ProblemSolved shared above:
for( let dots of document.getElementsByClassName("mc-button") ) { dots.click( ); for( let del of document.getElementsByClassName("delete-link")) { del.click(); for( let can of document.getElementsByClassName("dbmodal-button") ) { can.click( ); break; } break; } break; }
When I navigate to the Links page, access the console, and initiate the script, I get an undefined error. Is this due to the changes in the page design, or am I doing something wrong? Does anyone have any advice or an updated script that might work?
Thank you for reading!
- eliransapirNew member | Level 2
2023 Dropbox, browse to "shared" page, click "links" submenu, pase the code below into the console:
async function pause(ms) { return new Promise(resolve => { setTimeout(() => { resolve(); }, ms); }); } async function deleteLinks() { const deleteLinkTexts = ["Delete view link", "Delete edit link"]; // Both options let items = document.querySelectorAll('.share-page-row-actions [data-testid="open-menu-button"]'); for (let i = 0; i < items.length; i++) { items[i].click(); // Click the submenu button to open the menu await pause(1000); // Adjust the pause duration as needed // Find and click the appropriate delete link option const deleteLinkOption = Array.from(document.querySelectorAll('.dig-Menu-row-title')).find(item => deleteLinkTexts.includes(item.textContent)); if (deleteLinkOption) { deleteLinkOption.click(); // Click the delete link option await pause(1000); // Adjust the pause duration as needed // Find and click the delete button const deleteButton = document.getElementsByClassName("dbmodal-button"); if (deleteButton.length > 0) { deleteButton[0].click(); await pause(1000); // Adjust the pause duration as needed } } items = document.querySelectorAll('.share-page-row-actions [data-testid="open-menu-button"]'); // Refresh items } } deleteLinks();
- ProblemSolvedNew member | Level 2
Please be careful as it will delete all your shared links! You have been warned! Works in Chrome (61.0.3163.100) maybe firefox and internet explorer but no links to test =) Open the browser's console window (right click anywhere and select inspect or control+shift+i) while in the shared links page. Paste the following code in the console command line, click enter and it will delete all shared links.
Due to secure http loading jquery (as suggested by other post) does not work, so this option is fine with vanilla javascript. The script below simulates consecutive mouse clicks: 1. click the three dot button next to the link, 2. click the delete link button in the drop down, 3. click the delete link buttin in the pop up dialog box. Note that it will take a minute to execute all those but in the end the list shall be clear. Hope it save you some trouble... and again be careful
for( var index = 0; index < 1000; index++ )
{
var dots = document.getElementById("bubbleDropdownTarget-" + index );
if( dots == undefined ) continue;
dots.click( );
document.getElementsByClassName( "bubble-menu-item" )[0].click( );
document.getElementsByClassName( "button-primary dbmodal-button" )[0].click( );
}- ormajNew member | Level 2
This worked for me in Chrome. Oddly it looked to not show anything happening. Ilet the window just sit there for 5 mins, came back, and copied the Links URL in a new browser tab. Now, all the links that were there are now gone, and I've confirmed I'm no longer sharing any of the links from a massive list I had. If I need to reshare, I'll do so from a new URL, but now my old boss cant steal my work from my past time with him.
- JaneDropbox StaffI’ve accepted it as a Solution, as I had as chance to check it myself & the Javascript code worked as expected. Of course, I’d urge caution in using it on one's own Dropbox account (just rephrasing in case someone hasn’t noticed your initial warning)!Again, thanks for sharing & I hope you have a great rest of the day! :slight_smile:
- piousminionNew member | Level 2
Update:
Open your browser's debug/dev console and paste this:
var jq = document.createElement('script'); jq.src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq);
Hit enter, wait 2 seconds and paste this:
jQuery.noConflict(); setInterval( function(){ setTimeout(function(){jQuery('.mc-overflow-button')[0].click();}, 500) setTimeout(function(){jQuery('.delete-link')[0].click();}, 1000); setTimeout(function(){jQuery('.button-primary')[0].click();}, 1500);}, 1000);
Hit enter and wait for it to finish.
This was tested 2017/04/15 on Firefox, but should work on Chrome as well.- thewhitehouseHelpful | Level 5
No Worky :(
Content Security Policy: The page's settings blocked the loading of a resource at https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js ("script-src 'unsafe-eval' https://www.dropbox.com/static/compiled/js/ https://www.dropbox.com/static/javascript/ https://www.dropbox.com/static/api/ https://cfl.dropboxstatic.com/static/compiled/js/ https://www.dropboxstatic.com/static/compiled/js/ https://cfl.dropboxstatic.com/static/previews/ https://www.dropboxstatic.com/static/previews/ https://cfl.dropboxstatic.com/static/javascript/ https://www.dropboxstatic.com/static/javascript/ https://cfl.dropboxstatic.com/static/api/ https://www.dropboxstatic.com/static/api/ 'nonce-xxxxxxxxxxxxxxxx'").
- piousminionNew member | Level 2
I just tried it on Chrome.
I did get the error you described, but it worked anyway.
WHWYT(What Happens When You Try)?
- James H.40New member | Level 1
I had to open the console, import jquery, and have it click all the links for me. This will have it click "x" and the confirm button every second:
var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); // ... give time for script to load, then type. jQuery.noConflict();
setInterval(function(){jQuery('.remove-link')[0].click();setTimeout(function(){jQuery('.button-primary')[0].click()}, 500);}, 1000)- Dereck H.Helpful | Level 6
Thanks James. Quite stupid dropbox can't implement a real solution.
- Derek L.6New member | Level 1
If I select to "link & share" a folder I am sending to Client A, can all my other clients (with links to their own folders) also see Client A's folder? (even though it's nothing to do with them!). Clients don't always have Dropbox on their computers so I "link" them. It's just a security question I was worried about.
- Ben P.16New member | Level 1
If you never use public links, know what you are doing, and want to purge all links try the script below.
(No warranty, batteries not included)
https://gist.github.com/benpage26/f9ca98a317660ab99aa3f8ea223b2051
- Ben P.16New member | Level 1
There is a way to save screenshots to dropbox without creating the shared link by default, by using a built in feature of OS X and the terminal.
Open a terminal and issue these two commands:
defaults write com.apple.screencapture location ~/Dropbox/Screenshots
killall SystemUIServer
for details see:
http://mac-how-to.wonderhowto.com/how-to/change-default-save-location-screenshots-mac-os-x-for-cleaner-desktop-0160154/ - Clément C.Helpful | Level 5
Are you certain that feature doesn't already exist? I can't speak for Mac, but on Windows a link is only created when holding CTRL while taking the screenshot. Take it without that modifier key and it's just a screenshot without a link.
Hi Rich R. Thank you for the tip but it doesn't work on mac. On mac, it uses the same screenshot functionality that the system, with the same shortcuts, but dropbox automatically saves them in a dedicated folder in the dropbox instead of the desktop and automatically creates a link. But if it's possible on windows, it should be on mac... The annoying part is that the first message on this topic complaining about this mac only functionality is 6 months old, and nothing changed yet ;)
About Create, upload, and share
Find help to solve issues with creating, uploading, and sharing files and folders in Dropbox. Get support and advice from the Dropbox Community.
Need more support
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!