How To Enable Shortlinks In WordPress

By default, the Get Shortlinks button next to your permalink URL on the Edit Post/Page screen is hidden.

get_shortlink WordPress

You can enable it by adding this PHP code to the end of your child themes functions file or better still, a must use plugin.

add_filter( 'get_shortlink', function( $shortlink ) {
    return $shortlink;
});

Another option if its already shown, is to change the domain using code like this :

add_filter( 'get_shortlink', 'change_get_shortlink' );
function change_get_shortlink( $shortlink ) {
    return str_replace( 'example.com', 'wpsites.net', $shortlink );
}

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.