cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We've been busy working on some major updates to the Community, so check out what's changing, what’s staying the same and what you can expect from the Dropbox Community right here.

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.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

remove all shared links

remove all shared links

k s.4
New member | Level 1
Go to solution

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

46 Replies 46

ProblemSolved
New member | Level 2
Go to solution

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.

 

 

Defender9408
New member | Level 2
Go to solution

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!

eliransapir
New member | Level 2
Go to solution

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();

 

 

 

 

 

 

Defender9408
New member | Level 2
Go to solution

eliransapir, thank you so much. This works like a charm!

ripknoxx
New member | Level 2
Go to solution

Doesn't work anymore no matter what I try. any other suggestions. 

ripknoxx
New member | Level 2
Go to solution

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. 

visgean
Explorer | Level 3
Go to solution

If anyone is looking for solution in 2024: use the HTTP API. I made few scripts here: https://github.com/Visgean/check-dropbox-links/

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    visgean Explorer | Level 3
  • User avatar
    James H.40 New member | Level 1
  • User avatar
    Derek L.6 New member | Level 1
  • User avatar
    Ben P.16 New member | Level 1
What do Dropbox user levels mean?