Your cookie settings

This site uses proprietary operational cookies that have a purely functional purpose and third-party cookies that help us understand how visitors interact with the site by collecting and presenting information anonymously. To get more information about these cookies and the processing of your personal data, check our Privacy & Cookie Policy. Do you accept these cookies and the processing of personal data involved?

If you don’t, you can reject non-operational cookies and continue browsing this site by clicking here.

Skip to content

Nelio Software

  • Nelio
  • Pricing
  • Help
    • Documentation
    • Contact
  • Search

ANY DOUBTS?

Take a look at our knowledge base for more information.

How Can I Use Shortlinks on my Social Messages?

As you probably know, you can use the {permalink} tag when creating social messages in Nelio Content. This tag is then replaced by the actual link of your post. But you can obviously create the message using the link directly. That is, instead of writing this:

Look at my newest post {permalink}

You can write this:

Look at my newest post https://short.link/post

But there’s a problem with this solution: you need to manually create all the social messages…

SOLUTION

Our plugin defines the following filter: nelio_content_post_permalink, with two arguments: $permalink and $post_ID. This means that you can easily create a custom function to make sure your posts are shared using a short link instead of the long one.

Here’s (roughly) how you’d do it:

1. Add a custom field in your post named, for example, nc_short_url:

Custom field for defining the proper short link of the post.
Custom field for defining the proper short link of the post.

2. Create a custom function such as this:

function nc_use_custom_short_link( $permalink, $post_id ) {
  $short_link = get_post_meta( $post_id, 'nc_short_url', true );
  return empty( $short_link ) ? $permalink : $short_link;
}//end nc_use_custom_short_link()
add_filter( 'nelio_content_post_permalink', 'nc_use_custom_short_link', 10, 2 );

As you can see, it’s a pretty simple function (that’s connected to the filter we mentioned before): it basically retrieves the post meta we just added and, if there’s one available, it returns it. Otherwise, it uses the default permalink.

If you don’t know where to place this function, follow these instructions.

Contact Form

Not what you’re looking for? Ask us directly:

With your express consent, we handle the information provided for the purpose of contacting you and until you ask us to delete it.

Submit

Related Questions

  • Messages are not published on Facebook. Why?
  • How do I post messages on Pinterest?
  • Initialize and Customize Social Automations
  • How do I export the editorial calendar to Google Calendar?
  • What are Nelio Content’s advanced settings?
  • How to set up the editorial calendar?

Support Categories

  • First Steps
  • Scheduling and Automations
  • Content Assistant
  • Plugin Settings
  • Manage Account
  • Payments and Billing
  • Plugin
    • For Publishers
    • For eCommerce
    • For Marketers
    • For Nonprofits
  • Documentation
    • Introduction
    • Editorial Calendar
    • Social Automations
    • Press
  • Company
    • Team
    • Customers
    • Blog
    • Contact Us
      • Twitter
      • Facebook
      • LinkedIn
      • Instagram
      • Pinterest
      • Tumblr
      • YouTube
  • Español
  • English

You might also be interested in:

  • Legal Information
  • Privacy Policy
Copyright © 2022, Nelio Software SL