How can I change Item’s slug and slug of other custom post types?

Updated: January 31, 2020

If you want to change the slug or name of item in our WordPress Directory theme that appears in the website url (e.g. http://domain.xy/item/some-item) or some other keyword for other post types and taxonomies you can do it pretty easy following instructions below.
Note please, after permalinks change may be required to resave permalinks structure in database. Simply navigate to WordPress Permalinks page and click save to force WordPress save new structure into database.

Change slug from plugin files

Item slug in URL

In the file of Ait Toolkit plugin ./wp-content/plugins/ait-toolkit/cpts/item/@item.cpt.php you have to add new part rewrite as you can see on following image.

Change Item Post Slug

Item slug in breadcrumbs

If you want to change also the slug which appears in the breadcrumbs you must change the name parameter of labels section:

Change Item Post Name


Taxonomy slug

Exactly same way you can change the slugs for categories, locations or any taxonomies. Taxonomy of the post type is specified in the same file ./wp-content/plugins/ait-toolkit/cpts/item/@item.cpt.php

Change Taxonomy Slug

Important: If you can’t access any item or category after this modification and the only you get is 404 – Nothing Found page, please follow the instruction in this article. Keep in mind that this modifications will be replaced by original files each time the Ait Toolkit plugin is updated!

Change slug from functions.php

Following example is used for advanced users or developers, we do not guarantee broken funkcionality using own incorrectly implemented code example.

If you are using child theme, better way to change slugs of post types or taxonomies (archive pages) may be using of filters inside your functions.php file in child theme:


function change_post_types_slug( $args, $post_type ) {
   /*item post type slug*/   
   if ( 'ait-item' === $post_type ) {
      $args['rewrite']['slug'] = 'my-new-item-slug';

   /*standard event post type slug*/   
   if ( 'ait-event' === $post_type ) {
      $args['rewrite']['slug'] = 'my-new-event-slug';

   /*portfolio post type slug*/   
   if ( 'ait-portfolio-item' === $post_type ) {
      $args['rewrite']['slug'] = 'my-new-portfolio-slug';

   /*event pro post type slug, available with Events Pro plugin*/
   if ( 'ait-event-pro' === $post_type ) {
      $args['rewrite']['slug'] = 'my-new-eventpro-slug';

   return $args;
add_filter( 'register_post_type_args', 'change_post_types_slug', 10, 2 );

CHANGE SLUGS OF TAXONOMIES, slugs used for archive pages
function change_taxonomies_slug( $args, $taxonomy ) {
   /*item category*/
   if ( 'ait-items' === $taxonomy ) {
      $args['rewrite']['slug'] = 'my-new-category-slug';

   /*item and event pro locations*/
   if ( 'ait-locations' === $taxonomy ) {
      $args['rewrite']['slug'] = 'my-new-location-slug';

   /*item and event pro locations*/
   if ( 'ait-portfolios' === $taxonomy ) {
      $args['rewrite']['slug'] = 'my-new-portfolios-slug';

   /*event pro category, available with Events Pro plugin*/
   if ( 'ait-events-pro' === $taxonomy ) {
      $args['rewrite']['slug'] = 'udalosti';
   return $args;
add_filter( 'register_taxonomy_args', 'change_taxonomies_slug', 10, 2 );

Similar way you can change other parameters used for registered post type.

Author: Ivan Hudak

Support Manager
all themes, citadela layouts, plugins and graphics,
One time fee
Purchase Agency Lifetime Membership
Pre-sale Questions