WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Ryan v1.0.0

Permalink Shortcode

Provides a shortcode that allows you to insert permalinks into your content.

Permalink Shortcode

The facts

Rating
4★ from 4
Active installs
100+
Price
Free
Last updated
2 May 2013
Added
May 2013
Requires WP
2.8
Tested up to
WP 3.5.2
Downloads
3,517

Our analysis

AI-assisted

Permalink Shortcode is a WordPress plugin that allows you to create links to existing posts and pages using a shortcode. It offers two forms of usage: a standard format for inline links and an enclosing format for more complex link structures, both of which support various HTML attributes.

This plugin is suitable for users who want to maintain valid links even if the slugs of their posts or pages change, as it dynamically generates links based on the post ID provided. It is particularly useful for those who frequently link to internal content within their site.

Best for: This plugin suits WordPress users who need a reliable way to link to internal content.

What it does well

  • Supports standard and enclosing shortcode formats
  • Allows linking to existing posts and pages
  • Includes multiple HTML attributes for customisation

Where it falls short

  • Last updated in May 2013, may not be compatible with newer WordPress versions
  • Limited user ratings and active installs

Verdict

Permalink Shortcode provides a straightforward solution for creating dynamic links, but its age and limited support may be a concern for some users.

From the developer

Ryan's own description of Permalink Shortcode, lightly tidied.

Permalink Shortcode is a relatively simple plugin that implements a shortcode that you can use to link to existing posts and pages on your site. The shortcode also supports a number of HTML attributes (see below).

While WordPress does include a feature that allows you to link to existing content, this feature only inserts a “static” link. If you were to change the slug for that post or page, previously inserted links would no longer be valid.

The permalink shortcode can be used in two forms:

  1. Standard: <a href="[permalink wpid='123']">link text</a>
  2. Enclosing: [permalink wpid="123"]link text[/permalink]

(Note the single quotes used in the standard form example above. Using double quotes in this situation will not work.)

Supported Attributes

The following attributes are available in both the shortcode’s standard form and its enclosing form:

  • wpid: The ID number of the post or page to which you want a link.
  • query: The part of a URL that comes after the ‘?’ (e.g. “?foo=bar”). The ‘?’ is optional and will be added automatically if not included.
  • fragment: The part of the URL that comes after the ‘#’ (e.g. “#comments”). The ‘#’ is optional and will be added automatically if not included.

The following HTML attributes are available only in the shortcode’s enclosing form:

  • accesskey
  • charset
  • class
  • dir
  • hreflang
  • id
  • lang
  • media
  • rel
  • rev
  • style
  • target
  • title
  • type

Things to be aware of with some of the above attributes:

  • In the enclosing form, the CSS class name permalink-shortcode is always added to the class attribute, even if you don’t specify any class names yourself.
  • In the enclosing form, if no value is given for the title attribute, the post or page title will be used.

Usage Examples

Simple link (standard form):

<a href="[permalink wpid='123']">link text</a>

Result:

Read the full description on the official page →

Tagged as