Code snippets to remove the slug from custom post type URLs in WordPress, making your URLs cleaner and more user-friendly.
These code snippets help you remove the slug from custom post type URLs in WordPress. You can change quy_hoach
to your desired custom post type name to remove its slug.
-
Copy the Code:
- Copy the code snippets from the functions.php file in this repository and paste them into your child theme's functions.php file.
-
Replace Post Type Name:
- Replace 'quy_hoach' with your desired custom post type name to remove its slug from the URLs.
-
Save and Upload:
- Save the changes and upload the functions.php file back to your child theme's directory.
-
Verify:
- Visit your website and check the URLs of your custom post types to ensure the slugs have been removed.
Contributions are welcome! If you have any suggestions or improvements, please create a pull request or open an issue.