Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Jonathan Leon
Jonathan Leon
18,813 Points

Deleting multipile workspaces

I reached the 100 workspaces max, how can I delete multipile workspaces at once it's tedious to delete one by one as I progress :(

Hi Jonathan,

I came up with a hackish solution, where you can paste in some JavaScript into the dev console and it removes one workspace - without having to click three times (settings, delete, confirm).

Since the page reloads each time a workspace is deleted, it's much more non-trivial to write a script to delete them all. I image it entails telling your browser to load a script upon loading a certain page.

At any rate, feel free to use this script WITH CAUTION. Changes are permanent. Each time the code is used, it deletes the 0 element workspace, which seems to be the oldest workspace, first.

Use at your own risk of deleting a workspace you will not be able to recover.

Feel free to ask if you have any questions.

(function go() {  
  window.confirm = function() { return true; }
  $(".delete.right").click()
})()

Edit: several edits have been made to the code above.

Edit2: I used this code successfully to delete my workspaces, one at a time, from oldest to newest.

Jonathan Leon
Jonathan Leon
18,813 Points

Thanks that's a great Treehouse solution!