How to delete a content managed website

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

A content managed website is built using a content management system like Drupal, Joomla, WordPress, etc.  I’m not talking about managed hosting accounts such as WordPress.com.   But ones that you host yourself on your own web host.

In this tutorial example, we will delete a Joomla site.  Some of us has built sites using a content management system thinking the world will be reading it.  And it turns out no one is reading it, not even the writer.  So it is understandable why one might want to delete a site.

Are you sure you want to delete it?   In any case, you better make a full backup of it, just in case you changed your mind.  A full backup means, backing up the source files and all the plugins and theme files of the content management system.  Then a backup of the uploads and image files and content files.  And most important of all, the backup of the database.

So to delete the site, we have to remove all those things mentioned.

1.  Make full backup of site (just in case).

2. Delete the database

Find out what database the content management system is using.  In joomla, that info is in configuration.php.  In WordPress it is in wp-config.php.  In Drupal it is in sites/default/settings.php

Log into your webhost and delete that database.  You might also want to delete the database user for that database if that database user is only accessing that database.

Site should now give you “unable to connect to database” error.

3. Delete the site files.  

FTP into your webhost and delete the Joomla site files.  Make sure you are in the right folder and delete all its contents.

The components, modules, templates are in their corresponding directories.  The user uploaded images are in the images directory.  Delete all these directories.

If you use SSH (such as via putty), you first have to navigate (with cd) into the Joomla folder.  Make sure you are in the right folder (do a ls first)  before running this next dangerous command …

rm -rf *

This delete all files and all sub-folders within the current directory.   The -r flag remove directories recursively.  The -f flag is force the remove without providing user prompts like “are you sure?”.

This command doesn’t remove write-protected files or dot-files (such as the .htaccess files).  So next you want to do a ls to see what files it missed.  And then do a rm on those.  We need to …

rm .htaccess

to remove the .htaccess files.  Make sure you have turned on view of hidden files (the dot-files).

Then delete the site folder itself by going up one directory rmdir that directory.

4.  If site is hosted in a subdomain, you may want to remove that sub domain.

That’s it.  Everything gone.