How to Remove Sample Data in Joomla

Every now and then, we have clients asking us how to remove the sample data in Joomla. The sample data is the data that the Joomla installer loads into your website during the installation process (note that the Joomla installer asks for your permission to do this).

In any case, there are two ways to do this, one is by just deleting the articles and other data (such as polls and weblinks) manually (which is a tedious process), and the other way is by deleting the sample data using phpMyAdmin.

Before you start: Make sure you backup your Joomla website and download the backup to your PC. Backup instructions are explained in this article on moving your Joomla website from one server to the other. Also make sure you don’t perform any of the below if you have real data on your website, other than the Joomla sample data.

Option 1: Deleting sample data from the backend

Again, this is a tedious and ugly process. What you need to do is the following:

  • Login to Joomla’s backend using a super administrator’s username and password.
  • Click on “Article Manager”, select all articles and click on “Trash” above.
  • Click on “Front Page Manager”, select all items and click on “Remove” above.
  • Click on “Section Manager”, select all items and click on “Delete” above.
  • Click on “Category Manager”, select all items and click on “Delete” above.
  • Click on “Menu Manager”, and delete all menus with the exception of the menu called “Main Menu”.
  • Click on “Components”->”Banners”, select all items and click on “Delete” above.
  • Click on “Components”->”News feeds”->”Feeds”, select all items and click on “Delete” above.
  • Click on “Components”->”News feeds”->”Categories”, select all items and click on “Delete” above.
  • Click on “Components”->”Polls”, select all items and click on “Delete” above.
  • Click on “Components”->”Web links”->”Links”, select all items and click on “Delete” above.
  • Click on “Components”->”Web links”->”Categories”, select all items and click on “Delete” above.
  • Click on “Extensions”->”Module Manager”->”Categories”, select items that have an id > 15 and click on “Delete” above.

Option 2: Deleting sample data from the phpMyAdmin

This is the easiest and the most efficient way, and it literally takes seconds, but the caveat is that you need to have access to phpMyAdmin:

– Login to phpMyAdmin.
– Backup the database by clicking on the database name in the left panel, and then click on “Export” at the top, and then follow the instructions (we know that we have already downloaded the backup, but this is just to be on the safe side).
– Once you have downloaded the database, click on SQL on the top, paste the following into the large textarea, and then click on “Go”:

TRUNCATE TABLE `jos_weblinks`;
TRUNCATE TABLE `jos_sections`;
TRUNCATE TABLE `jos_polls`;
TRUNCATE TABLE `jos_poll_data`;
TRUNCATE TABLE `jos_poll_date`;
TRUNCATE TABLE `jos_newsfeeds`;
DELETE FROM `jos_modules_menu` WHERE `moduleid` != 1 AND `menuid` != 0;
DELETE FROM `jos_modules` WHERE `id` > 15;
DELETE FROM `jos_menu_types` WHERE `id` > 1;
DELETE FROM `jos_menu` WHERE `id` > 1;
TRUNCATE TABLE `jos_content_frontpage`;
TRUNCATE TABLE `jos_content`;
TRUNCATE TABLE `jos_contact_details`;
TRUNCATE TABLE `jos_categories`;
TRUNCATE TABLE `jos_bannerclient`;
TRUNCATE TABLE `jos_banner`;

Substitute jos with the prefix of your website in case you changed it during the installation process (most of the times you don’t need to change anything in the script above).

That’s it!

If you encounter any problems during this process, then feel free to contact us, we will be more than glad to help you, we are also very fast and our fees are very reasonable!

No comments yet.

Leave a comment