• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems