Is it possible to use a post name in a custom post slug?

Rewrite is a global base for all posts under the custom post type. For example, this is the default CPT rewrite structure: example.com/lesson/%postname% In your code example, it’s implying you are trying to do: example.com/%postname%-lesson/%postname% Two issues with this idea. The first issue, assuming this functionality worked, is that your CPT urls would all be … Read more

WordPress not remembering old slugs for pages

WordPress keeps track of post slug change with wp_check_for_changed_slugs() function. The old slugs are saved in wp_postmeta table with _wp_old_slug meta_key and later redirects to current URL with wp_old_slug_redirect() function. That’s why even after changing a post’s slug, you get redirected to the correct post. However, WordPress doesn’t do this by default with pages (or … Read more

Pages resolve at different URLs (different capitalizations)

Have you moved servers recently? In years past, Windows servers always treated them differently than on unix servers. Barring that, you can edit your .htaccess file to convert all URLs to lowercase. Here’s a guide editing depending if you have access to httpd.conf file or not; https://www.rewriteguide.com/apache-enforce-lower-case-urls/ As suggested by @Rup, a canonical URL should … Read more