I know about edit_form_after_title hook but what about changing the permalink. How does WordPress creates permalink because that permalink and the one that get_the_permalink returns doesn't match? Could someone help me?

  • This recent question here might be somewhat related? I list there some actions/filters that might be useful for your task/debugging.
    – birgire
    Jun 25 '15 at 8:51

You can use the the_permalink filter to modify permalinks.

Take a look at the function reference for the same.

Code sample from the docs:

Append the query string for the current page to permalink URLs

function append_query_string($url) {
    return add_query_arg($_GET, $url);
add_filter('the_permalink', 'append_query_string');

More information on permalinks:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.