Skip to content

Manage categories and locations in classifieds website [easy bulk import]

Depending on your website requirement you may need to have some categories and locations in your classifieds website. For small niche websites you can use classifieds website script without any category and location. For big websites it is suggested to have appropriate categories and locations  for grouping ads (listings) and making navigation easy.

In Classibase you can have unlimited number of categories and locations with unlimited levels of subcategories.

In this tutorial we explain how to add, edit and delete categories (manage categories) in your classifieds website using classibase script. Managing locations is similar to categories so you can perform similar actions for locations (manage locations like countries, states, cities) as well. You will also learn how to bulk import locations and categories. After adding your categories and locations you can show them in front end for navigating in classified ads website.

How to add and edit category in classified ads website?

Manage categories in classified ads website. Learn how to add or edit categories and sub categories.

  1. Navigate to “Manage” -> “Categories” from admin panel
  2. Click on existing category name if you want to add subcategory to it or view existing subcategories
  3. Click on “Add new” button to add new category to existing level, click on “Edit” button if you want to edit related category.
  4. New page will load. Fill in form details.
    • Parent category – if you want to add current category under other existing category then select parent category. You can change parent category whenever you want. Ads will stay in this category even if you change parent category.
    • Name – Category name
    • Description – category description which will be displayed on category listing page. Put informative and encouraging add new item text here.  You can use {@LOCATION_OR_SITETITLE} variable to display active location.  It is good for SEO and site visitors as well. They will know for which location items listed. For every location you will have custom category description mentioning location name in description. If you list for all locations then site name will be used instead location name.
    • Permalink – how your category url will appear. It is also important for SEO
    • Locked – if you have subcategories of current category then by locking it you force  posting ads to related subcategory not to category itself. It is good if you have generic category and specific subcategories. If you do not have any subcategory then do not lock it because users will not be able to post ads into it. Locking and unlocking done automatically so you can ignore it.
    •  Enabled – enabling will make it visible to public and users can add items to it. You can use it later to enable or disable categories temporarily
  5. If you defined other languages in classifieds website then you will see language tab in category adding / editing form.  Click on each language to add translation.
  6. Permalink is automatically generated from category name of default language. You can change it  by clicking edit button next to it
  7. After finishing all changes click “Submit” to save changes.

Column name and description for categories page

There are some columns on categories page:

  • Name – name of category
  • Ads – number of currently running ads in category and subcategories. Bu clicking you can view them in admin panel for editing.
  • Sub – number of sub categories
  • Locked – if category has sub categories then good to keep them locked to force ad posting into related sub categories. State can be changed by clicking on a button.
  • Enabled – shows if category enabled, state can be changed by clicking on a button.
  • Position – buttons to change category order. Categories listed using this order every ware for consistency.
  • Custom – links to custom fields editing area
  • Edit – button for editing category
  • Delete – button for deleting category

Adding and editing location is similar to editing categories.

How to delete category in classified ads website?

How to delete categories. Select category and confirm on next page.

  1. Navigate to “Manage” -> “Categories” page from admin panel. If you want delete sub category then navigate there by clicking on category name.
  2. Click on “Delete” button for category
  3. New confirmation page will open. Select “Yes, delete this category and subcategories.” checkbox. If there are subcategories listed on this page they are also will be deleted.
  4. Click “Submit” button for deleting category and sub categories.

Deleting category will not delete ads inside that category

When category with ads deleted existing ads will be listed without any category where all ads listed. To list those ads you need to tick checkbox ‘Display "View more" link’  in ads widget. Otherwise it will not be possible to navigate and view those ads without category.

Single category classifieds websites generally used with big blog or website for niche listings like jobs or sell items. When you delete all categories site visitors will post ad listings without category. Learn more about classified ads website without categories.

Even after deleting all categories you still can use “Category custom fields” for applying to all ads. View tutorial about adding custom fields.

Deleting location is also works same way as deleting category.

Bulk upload categories and locations in classified ads website

When you first setup classifieds website you need to add categories and locations. For big websites locations can be many thousands. It would be hard to add all those locations one by one. That is why we have bulk insert feature for locations and categories in Classibase script.

I will explain how to import locations. Importing categories is also similar to it.

Step 1: Create locations text file with sublocations.

To import locations or categories you need to create text file in following format.


After creating locations text (.txt) file in required format with | separator for sub locations make sure to save it in UTF-8 encoded . You can use notepad++ (for windows PCs) text editor to make sure that file is saved in UTF-8 encoding.

Step 2: Import locations file in admin panel

Bulk import locations. Create locations text file and upload in admin panel.

  1. Navigate to “Tools”->”Import data” page in admin panel. Make sure that you selected location tab at the top of the page.
  2. Click "Choose file" and select text file with locations.
  3. Click "Import" button.

Page will upload your text file and start importing all locations from it. If you have too many locations and your server cannot import them at once it will be imported in small batches. You may have to wait couple seconds until importing completes.

Locations already existing on your website will be skipped if their names match.

After importing you can navigate to "Manage" -> "Locations" in admin panel and see imported locations.

Same procedure applies for bulk importing categories and sub categories using text file.

Using same "Import data" page you can import ads from other website as well. When you import ads locations and categories from that ads file will also be imported. Additionally related custom fields, user emails and ad images will be imported. You can learn more about importing ads in detailed tutorial.

How to list categories on front end?

After having defined your categories you can manage how categories will be shown on your classifieds website. When you install Classibase classifieds script categories widget will be already created and displayed in your front end for site visitors. You can add other widgets or change existing category widget settings.

For editing category widget or add new one navigate to “Appearance” -> “Widgets” page from admin panel. Open existing sidebars for category widget or drag category widget from “Available widgets” to opened sidebar. Then click “Edit” next to category widget. View tutorial about categories widget.

Here are available category widget settings:

Category widget settings in Classibase classified ads admin panel

  • Title – widget title, if left blank automated title “Categories” will be used.
  • Hide title – check box if you do not want to display title at all. Usually used if you display categories in front page or on top of ad listings. Because you do not want to occupy extra space for title as it will be obvious that there are categories or sub categories for current category.
  • Display mode – define how your categories will be listed
    • Dynamic – this will display current category and open all parents of current category. Also will open current category if has sub categories. Will hide sub categories for other parent categories. It is good for clear navigation on sidebars.
    • Dynamic minimal – Same as dynamic but will not list neighbors of active or opened category. Will list sub categories if there are any. Good to use if you want to save some space and reduce content on sidebars.
    • Fixed 1 levels – displays only one level of categories, will not list any subcategories. Good to use on listing and home page at the top before content.
    • Fixed 2 levels – displays 2 levels, category and sub category if there are any. Good to use on home page.
    • Fixed 3 levels – displays 3 levels, category, sub category and sub of sub category.
    • Fixed all levels -  will display all categories and sub categories.
  • Display ad count – will display number of ads in every category. If there are no ads in category, will not display any number, we do not want to crowd web page. It is good for site visitor to know and not visit that category if there are no ads in it. Also visitors will be impressed if you have many ads in category, it gives good reputation for your classifieds website. Ad count will be different for each location so this option will show number of ads in current location and related category. Counting ads is resource consuming task and we optimized Classibase for counting ads for all location and categories once and cache results for 1 hour.
  • Related to active category – if selected will display sub categories of active category. If no active category then will display main categories.

Locations widget options are similar to category widget options.

Want to show categories with images? Then check this tutorial.


How to manage locations (add/edit/delete) in classified ads website?

Managing locations is similar to categories. They both have similar pages to add, edit and delete locations.

Can I have classified ads website without categories/locations?

Yes you can have classified ads website if you are planning to have very limited number of listings. Generally it is more convenient to have such small classifieds website for premium job listings or selling niche items within targeted community. Learn more about setting up classified ads website without categories.

How many categories and locations classibase supports?

Classibase PHP classifieds website script supports having unlimited number of locations and categories with unlimited levels deep. Building such a big website may require more server resources. If you are just starting our then start small and add more locations as you grow. For multi country websites it may be better to build separate website for each country. This way you can have more focused traffic and can use separate server for each classibase installation.

How many levels deep categories and locations in classified ads website?

Location and category levels are not limited. You can have multi level locations like Country/State/Coty/Area etc.

Categories also can be multi level. It is advised to build categories in pyramid structure. For example 5-10 main categories. Each divided to 10 sub categories. Then each further divided to 10 sub sub categories. Some categories can go 3 levels deep other may go 10 levels deep. It is all up to your requirements.

Where to get locations file for any country?

We do not provide location or category data for bulk importing. You have to build it yourself depending on your country. You can get list of countries, states and cities using Wikipedia or other popular classifieds websites.

Can I bulk import description for locations/categories?

Bulk import imports only names. It is not possible to import descriptions with bulk import. You can to add descriptions manually for each location and category.

Conclusion for managing locations and categories

Categories and locations are main navigational and structural parts of good classifieds website. They will help to classify ads in appropriate categories. Users will find quickly what they look for using logical navigation with categories.

Locations will help to show listings in your city. Users generally will not be interested in items across whole country. Instead they want to buy or sell items in local community.

In this tutorial we learned how to manage and bulk import locations and categories in PHP classifieds website software Classibase. You will need this information after installation to building your website.