Hi @nitinsinghal,
Could you check if the “Default URI” in URI Editor contains uppercase letters?

Best regards,
Maciej
Hi @mbis
When I first created the page with wp_insert_post, it does not contain the uppercase letters. For uppercase, I had to edit in the URI Editor manually for every page.
regards
Hi @nitinsinghal,
Please note that by default my plugin uses the native slugs that are sanitized by WordPress and are always lowercase:
https://permalinkmanager.pro/docs/faq/native-slug-in-wordpress-permalinks/
Does the issue occur also when you switch “slugs mode” to “Use actual titles as slugs“? Then, my plugin should use not the native slugs (that are always lowercase), but the post titles (with uppercase):
https://permalinkmanager.pro/docs/plugin-settings/slugs-mode/
Best regards,
Maciej
Hi @mbis
Now there is a different issue:
With wp_insert_post, 2 main option of my array is:
Array
(
[post_title] => Alabama – office
[post_name] => Alabama-AL
)
Case 1 -> Slugs Mode as use “native slugs” : URL is “find-office/alabama-al” : which is not in uppercase.
Case 1 -> Slugs Mode as use “Use actual titles as slugs” : URL is “Find-office/Alabama-office” : which is in uppercase, but I want “post_name” as slug
I hope you have understood my issue.
Regards
Hi @nitinsinghal,
As I mentioned before, the native slug is converted to lowercase when the post is added with wp_insert_post() function. It happens directly in WordPress core:
https://github.com/WordPress/WordPress/blob/3336009e34a2848717e72065efb0b11f69d61237/wp-includes/formatting.php#L2228
In short, even if you use uppercase letters as an argument for wp_insert_post():
[post_name] => Alabama-AL
WordPress will save the native slug as:
[post_name] => alabama-aL
This particular issue is not related to my plugin. The tricky solution for this issue was posted here:
https://wordpress.stackexchange.com/a/5032/38240
Hi @mbis
I know this issue is not related to your plugin, but I thought there might some option in your plugin so that we can add uppercase slug with wp_insert_post().
I have already seen this https://wordpress.stackexchange.com/a/5032/38240, but I wanted to use a standard plugin.
Regards
Hi @nitinsinghal,
Ok, I see. I am afraid that it will not be possible to “automate” it with my plugin, since the slug (post_name) is converted to lowercase and stored only in wp_posts table (without uppercase letters).
To sum up, there are only two possibilities:
- you can manually adjust each of custom permalinks and add the uppercase letters
- you can use the post titles instead of native slugs – post titles contain uppercase letters but are different than slugs in your particular case
Best regards,
Maciej
Hi @mbis
Yes, thanks for the suggestion. I think, I will have to take the first option.
Regards
Nitin