How to allow dot(.) in slug for custom pages

For this question, I googled and found 2 results. But what I want to do is allow dots in slugs for some pages only. I found results are showing to add a function to function.php file. But it will affect the whole site. I need to change (-) as (.) only custom pages URLs.

Default: https://test.com/selected-slug-goes-here
To change: https://test.com/selected.slug.goes.here

And also keep some URLs like

(with extensions)https://test.com/slug.html

So please help me with this.

What I found so far>>>

Allow dot in wordpress permalinks (only for categories)

How to add dot(“.”) in post slug

Read more here:: How to allow dot(.) in slug for custom pages

Leave a Reply

Your email address will not be published. Required fields are marked *