How to remove ?p= from WordPress short links?

I removed ?p= from wp_get_shortlink and it’s get the links without ?p= successfully but the problem that this links not working until added ?p= so how can make links working without added ?p=.

Read more here: How to remove ?p= from wordpress short links


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: