why does my url not update after migration?

When editing content in the content editor WordPress hardcodes the current URL that is being used to access the WordPress admin. This is usually found in link href and image src. There are several plugins or tools (like wp-cli) that can assist you in finding and replacing the url between environments. You will likely want … Read more

Custom template won’t load for a custom post type (custom permalinks used)

The problem in your code is the lack of proper rules. You add ‘rewrite’ => ‘CPT/%states%’ in register_post_type() arguments. This causes that the rules generated for pathologists post type begins with pathologists/%states%/ and the address pathologists/alabama/ (pathologists/{term}/) will not be matched. More importantly, all posts from the custom category are displayed regardless of the type, … Read more

Remove post type slug of all post types from permalinks

function gp_remove_cpt_slug( $post_link, $post ) { if ( ‘race’ === $post->post_type && ‘publish’ === $post->post_status ) { $post_link = str_replace( “https://wordpress.stackexchange.com/” . $post->post_type . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/”, $post_link ); } return $post_link; } add_filter( ‘post_type_link’, ‘gp_remove_cpt_slug’, 10, 2 ); At this point, trying to view the link would result in a 404 (Page Not Found) error. … Read more

Adding parent pages to posts

Changing any URLs will have an effect on your SEO. So, if you want zero effect on SEO, you cannot also change URLs from example.com/post to example.com/blog/post. You’ll want to look at how well-established your site is – if you have hundreds or thousands of posts that are ranking well, you likely should not change … Read more