Support » Plugin: Social » [Plugin: Social] Url given to Twitter

  • Resolved msebald


    As a new user of Social (I upgraded the Twitter Tools plugin which now uses Social) I noticed that Social has some effects that Twitter Tools did not have when posting new articles to Twitter.

    For example the link sent to Twitter looks like this http://www.domain.tld/?p=106 instead of http://www.domain.tld/2012/10/15/article (which in my case is the url scheme given in WordPress config).

    Also I do not have any chance to set an url shortener like or an own URL shortener like YOURLS. Twitter Tools had some extra plugins for this.

    Will the first issue be resolved and what about the second issue, which is more like a feature request?


Viewing 8 replies - 1 through 8 (of 8 total)
  • This was bugging me as well. I was able to tweak the plugin to change this manually. It was easy enough. Just do a find and replace of all instances of wp_get_shortlink with get_permalink.

    I found five that needed to be replaced:

    Search "wp_get_shortlink" (5 hits in 3 files)
      \wp-content\plugins\social\lib\social\controller\aggregation.php (1 hits)
    	Line 38: 		$url = wp_get_shortlink($post->ID);
      \wp-content\plugins\social\lib\social\service.php (2 hits)
    	Line 386: 					$url = wp_get_shortlink($post->ID);
    	Line 462: 					$url = wp_get_shortlink($comment->comment_post_ID);
      \wp-content\plugins\social\social.php (2 hits)
    	Line 140: 			$url = wp_get_shortlink($post->ID);
    	Line 1121: 			$shortlink = wp_get_shortlink($post_id);

    There were also two instances in the README.txt file but those can be ignored.

    The only problem is when you do this it will truncate the other content in your Tweet, e.g.

    Another option I found (which is probably what I’ll be using) is to install this plugin, which replaces the output of wp_get_shortlink with a URL, and adds a nifty little stats tracking link right to your posts admin page.

    Hi Tim,

    thank you for this hack/fix, which I already implemented. Sure the tweet will be truncated if too long, but normally I only post the article title, which should fit into the tweet also with the longer URL.

    Would this fix not be a good thing to put into the plugin, to chosse between shortlink and permalink?


    We came on here about this issue as well. We’d prefer not to hack the plugin itself and we don’t want our post titles to be truncated in our tweets so we might try to the plugin.


    Do you know if the shortlink resolves to the post’s actual pretty permalink?

    If we have shortlinks turned on in Jetpack, Social will send a shortlink that goes to a shortlink that finally resolves as a link.

    If we turn off shortlinks in Jetpack, Scial will send the link, which I think Twitter will shorten as a link, but eventually resolves as the URL.

    Thanks for your help.

    Please read the documentation…


    I think many people are asking for native support. Is this something we can expect in the future? I’m hopeful Social will handle this instead of yet another plugin and some coding – which I consider no different than the hacks presented above.

    Hopefully support will be re-introduced in a future version. has a WP plugin, why should Social or Twitter Tools duplicate that code?

    I use Bitly with a custom URL. If you use the Woo Dojo plugin, enable the Short Link option, which will generates short URLs for your posts, using your URL shortening service of choice – either or Tiny url – not sure about the others.

    When posts are broadcast with Social, links are automatically shortened with the custom url

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Social] Url given to Twitter’ is closed to new replies.