Quickly Delete Vercel Projects
Quickly Delete Vercel Projects

Quickly Delete Vercel Projects

Tags
Vercel
Javascript
Published
December 27, 2022
Author
Clark Weckmann
I recently needed to delete a large number of projects that I had hosted on Vercel. It became time-consuming to type out the name of each project and manually delete it, so I wrote a script to automate this process. I hope this script will be helpful to others who may be in a similar situation.
// Opens the settings menu var settingsButton = document.querySelector('a[data-testid="submenu/settings"]'); settingsButton.click(); // wait for the page to load. setTimeout(startDelete, 700); function startDelete() { // Target the delete button var deleteButton = document.querySelector('button.geist-themed.geist-error.geist-error-fill'); // click button deleteButton.click(); // wait for the popup setTimeout(deleteProject, 700); } function deleteProject() { // get the project's name var text = document.querySelectorAll('label>div>p>b')[0].innerText; // get the "delete my project text" var text2 = document.querySelectorAll('label>div>p>b')[1].innerText; // Type the text var input = document.querySelector('input[data-testid="resource-deletion-modal/name-input"]'); input.value = text; var input2 = document.querySelector('input[data-testid="resource-deletion-modal/verification-input"]'); input2.value = text2; // click the confirm delete button var confirmButton = document.querySelector('button[data-testid="resource-deletion-modal/confirm-button"]'); confirmButton.click(); }
Using this script is straightforward. First, navigate to the project you want to delete on Vercel. Then, open the browser's console by pressing F12 or right-clicking and selecting "Inspect Element." Finally, paste the script into the console and run it to delete the project.

Using This Script

To begin using this script navigate to your Vercel Dashboard and select the project you want to delete.
notion image
After selecting the project for deletion right-click and select inspect element or press F12 to open the developer tool menu.
notion image
Paste the code into the console after ensuring this is the correct project.
notion image
Press enter and watch the magic.