WPSSO – New JetPack Breaks Shortlinks for CPTs

A number of WPSSO Core customers using JetPack have reported that shortlinks no longer work for Custom Post Types (CPTs). According to JetPack, this is a feature, and PHP code specifically for this JetPack feature must be added to your functions.php file — or an additional property added to the Custom Post Type definition. Unless you have made these PHP code changes, JetPack will break the WordPress wp_get_shortlink() function for all Custom Post Types.

Because of this new JetPack feature, older versions of WPSSO Core (before version 3.48.7) may show a warning on Custom Post Type editing pages that the post shortlink is empty — which also prevents WPSSO Core from checking the current post webpage for duplicate meta tags. Additionally, the WordPress “Get Shortlink” button on post editing pages and the link rel="shortlink" HTML tag in webpage headers will be missing.

WPSSO Core version 3.48.7 now checks for empty values returned by the wp_get_shortlink() function and provides a correct shortlink URL. This not only addresses the new Jetpack feature, but also fixes incorrectly coded themes that disable the link rel="shortlink" HTML tag by returning an empty shortlink value (a violation of the WordPress theme guidelines).

I’ve opened an issue on with JetPack on GitHub for this bug which is currently labelled as a normal priority bug.

Find this content useful? Share it with your friends!