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 );
}

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.