Important Info: In version 1.4.23 we’ve had a bug related to the url rewrite that could result in a server error and crash the site. It has been fixed with version 1.4.25!
You can change the slug from oum-location to something else with this PHP (add it to your theme’s functions.php or use a Code Snippet plugin):
PHP
function my_oum_location_custom_slug( $args, $post_type ) {
if ( 'oum-location' === $post_type ) {
// Check if rewrite is enabled
if ( ! empty( $args['rewrite'] ) ) {
// If rewrite is a boolean true, convert it to an array first
if ( $args['rewrite'] === true ) {
$args['rewrite'] = array( 'slug' => 'new-location-slug' ); // Change 'new-location-slug' to whatever slug you want
}
// If rewrite is already an array, just update the slug
elseif ( is_array( $args['rewrite'] ) ) {
$args['rewrite']['slug'] = 'new-location-slug'; // Change 'new-location-slug' to whatever slug you want
}
}
}
return $args;
}
add_filter( 'register_post_type_args', 'my_oum_location_custom_slug', 10, 2 );After adding the above code, go to Settings → Permalinks in the WordPress admin and simply click “Save Changes” to flush the rewrite rules. You don’t need to change anything else, just saving the page once will flush the permalinks.