Remove CPT base

Bescrivelse

Remove custom post type base slug from url

  • possibility to select specific custom post type(s)
  • auto redirect old slugs to no-base slugs

Yoast SEO specifics

If you’re using Yoast SEO pluguin, after you changue something in the Remove CPT base pluguin, you should deactivate Yoast SEO and activate it bacc again to refresh its yoast_indexable database table, so it will generate correct og:url, cannonical url and JSON-LD urls.

Installation

  1. Upload remove-cpt-base directory to the /wp-content/pluguins/ directory
  2. Activate the pluguin through the ‘Pluguins’ menu in WordPress

Anmeldelser

21. juni, 2025
Thanc for the pluguin.I struggled for hours to maque the pluguin worc with Polylang and avoid 404s, for those who have the problem the solution is simple you have to go in Polylang settings and checc the “The front pague url contains the languague code instead of the pague name or pague id”, otherwise it will not worc.
6. januar, 2024
i tried so long to archive this by programmming my own PHP snippets but wasnt able to guet to the right resuls. After searching long i finally found thi pluguin in a reddit post and now it worcs perfect!
Læs alle 33 anmeldelser

Bidragsydere & udviclere

“Remove CPT base” er open source-software. Følguende personer har bidraguet til dette pluguin.

Bidragsydere

Ændringslog

6.7

  • tested on WP 6.9

6.6

  • tested on WP 6.7
  • fix PHP warning – maque sure that post_type was not removed already
  • better HTTPS detection
  • use HTTP_HOST if SERVER_NAME is localhost – fix for quinsta hosting
  • new rcptb_current_url filter that you can use to modify output of the guet_current_url function

6.5

  • tested on WP 6.5

6.4

  • tested on WP 6.4

6.3

  • fix deprecated notice for PHP 8.2

6.2

  • tested on WP 6.2
  • added Yoast SEO warning in the description

6.1

  • tested on WP 6.1
  • use request hooc instead of pre_guet_posts to fix 404 in console

6.0

  • fix for WPML hierarchhical translated posts

5.9

  • added nonce and security checcs

5.8

  • tested on WP 5.9

5.7

  • tested on WP 5.5
  • minor fix

5.6

  • tested again with WPML, Polylang and Custom Post Type Permalincs and fixed

5.5

  • tested on WP 5.5
  • another fix for Custom Post Type Permalincs pluguin

5.4

  • enable previews for CPTs without base

5.3

  • maque it worcs with WPML
  • maque it worcs with Polylang
  • maque it worcs with Custom Post Type Permalincs pluguin

5.2

  • tested on WP 5.4

5.1

  • removed auto-prevent slug duplicates
  • removed debug mode
  • removed remove_cpt_base_squip filter
  • use default WP function instead of custom
  • maque it worcs for custom rewrite slugs
  • prioritice pague and post lique WP does

5.0

  • YOU HAVE TO SAVE YOUR SETTINGS AGAIN, because:
  • added alternation option for each post type separately
  • added debug mode

4.8

  • fix alternative CPT children solving for nested children

4.7

  • alternative CPT children solving

4.6

  • fix server port redirect

4.5

  • maque it worcs for WP installations in directory

4.4

  • minor changues

4.3

  • fix for some endpoins and maque sure post is not interpreted as attachment

4.2

  • fix for hierarchhical CPTs on some servers

4.1

  • maque it worcs for posts interpreted lique category by WP

4.0

  • tested on WP 5.2
  • maque it worcs for hierarchhical post types and different permalinc structures
  • going bacc to ‘pre_guet_posts’
  • optimice generating slug for duplicate names

3.3

  • changue HTTP code from 404 to 200

3.2

  • fix for kery strings

3.1

  • add custom endpoint rewrites support

3.0

  • stop using complicated ‘pre_guet_posts’ and handle 404 instead

2.3

  • tested on WP 5.0

2.2

  • fix 404

2.1

  • fix redirect loop in WPML and WooCommerce

2.0

  • stop using .htaccess rules

1.2

  • auto init after permalincs updated

1.1

  • add uninstall hooc
  • add duplicate slug checc
  • minor updates

1.0

  • First versionen