What is Publicize?
Publicize is a module of the popular Jetpack plugin which enables automatic sharing of WordPress blog posts when published first time. Since Jetpack has multiple other modules like Site Stats, Uptime Monitoring, Social Sharing Buttons, etc. it is an easy way for WordPress site owners to choose Publicize module for auto sharing of posts. Publicize allows to connect to six social sharing sites – Facebook, Twitter, Google+, Path, LinkedIn and Tumblr and the advantage is that the connections can be shared among administrators, editors, contributors and other user groups.
Publicize Social Sharing Options
Default Sharing of Ugly Permalinks
Once the plugin is installed and the module is activated, the blog posts during first time publishing will automatically be shared on the connected social accounts. The problem here is that the shared post URL will be the ugly permalinks WordPress URL like “yoursite.com/p?123” instead of the URL with the description (or the option you have chosen for your URL permalinks). Below is the post shared by publicize on Facebook showing the permanent URL with post number:
Jetpack Publicize Sharing Ugly Permalinks on Facebook
The ugly URL is being shared on all connected social accounts like Facebook, Twitter and Google+.
How to Share Pretty Permalinks URL?
In order to fix the issue and share the pretty permalinks URL, add the below code in “functions.php” file of your theme. You can either use FTP or hosting account and navigate to the active theme folder to locate “functions.php” file.
function tweakjp_cust_shortlink() { global $post; if ( !$post ) return; return get_permalink($post->ID); } add_filter( 'get_shortlink', 'tweakjp_cust_shortlink' );
Ensure not to leave any blank spaces at the last line. Henceforth all new blog posts published will be shared with the pretty permalinks URL as shown below:
Sharing Pretty Permalinks with Publicize
Leave a Reply
Your email is safe with us.