Plugin / Linkify Text

Scott Reilly

Frequently Asked Questions (FAQ)

Install via the built-in WordPress plugin installer. Or download and unzip linkify-text.zip inside the plugins directory for your site (typically wp-content/plugins/) Activate the plugin through the ‘Plugins’ admin menu in WordPress (optional) Go to the Settings -> Linkify Text admin options page and define text and the URLs they should point to
No. The plugin filters post content on-the-fly.
Yes, if they include terms that you have defined to be linkified.
By default, the plugin filters the post content, post excerpt fields, widget text, and optionally comments and comment excerpts. You can use the ‘c2c_linkify_text_filters’ filter to modify that behavior (see Filters section). There is a setting you can change to make text linkifications apply to comments as well.
By default, yes. There is a setting you can change to make it case insensitive. Or if you are a coder, you can use the ‘c2c_linkify_text_case_sensitive’ filter (see Filters section).
Already linked text will not get linked again by this plugin (regardless of what the link may be).
By default, yes. There is a setting you can change so that only the first occurrence of the term in the post gets linked. Or if you are a coder, you can use the ‘c2c_linkify_text_replace_once’ filter (see Filters section).
Yes. You can reference another term by specifying its link as another term in the list prepended with a colon (‘:’). For instance: WP => https://wordpress.org, WordPress => :WP dotorg => :WP Given the above terms to link, all terms would link to ‘https://wordpress.org’. The latter two all reference the link used for the term “WP”. NOTE: The referenced term must have an actual link defined and not be a reference to another term. (Basically, nested references are not currently supported.)
You can add to the list of filters that get text linkified using something like this (added to your theme’s functions.php file, for instance): /** * Enable text linkification for custom fields. * * @param array $filters Array of filters that the plugin should hook. * @return array */ function more_text_replacements( $filters ) { $filters[] = 'the_meta'; // Here you could put in the name of any filter you want return $filters; } add_filter( 'c2c_linkify_text_filters', 'more_text_replacements' );
No. The plugin applies fully to the post content. With some non-trivial coding the plugin could be utilized to affect only targeted parts of a post’s content, but it’s not something that will be built into the plugin.
Yes, with a bit of code. You can define the title attribute text in your replacement string, like so: WP => https://wordpress.org || This is the link title Now the code: /** * Force links created by Linkify Text plugin to open in a new tab. * * @param array $attrs The associative array of attributes to be used for the link. * @param string $old_text The text being replaced/linkified. * @param string $link_for_text The URL that $old_text is to be linked to. * @return array */ function add_title_attribute_to_linkified_text( $attrs, $old_text, $link_for_text ) { // The string that you chose to separate the link URL and the title attribute text. $separator = ' || '; // Only change the linked text if a title has been defined if ( false !== strpos( $link_for_text, $separator ) ) { // Get the link and title that was defined for the text to be linked. list( $url, $title ) = explode( $separator, $link_for_text, 2 ); // Set the attributes ('href' must be overridden to be a proper URL). $attrs['href'] = $url; $attrs['title'] = $title; } return $attrs; } add_filter( 'c2c_linkify_text_link_attrs', 'add_title_attribute_to_linkified_text', 10, 3 );
Yes, with some custom code making use of the ‘c2c_linkify_text_linked_text’ filter. The code should determine if the given text linkification should be disabled, and if so, return the second argument sent via the filter. See the docs for the ‘c2c_linkify_text_linked_text’ filter for an example of how a custom field could be used to disable all text linkifications on a per-post basis. No doubt your particular situation will require custom logic to determine when to disable linkification.
Yes.

Ratings

3.8
12 reviews

Rating breakdown

Details Information

Version

1.9.1

First Released

19 Nov, 2011

Total Downloads

19,076

Wordpress Version

4.7 or higher

Tested up to:

4.9.12

Require PHP Version:

-

Tags

Contributors

Languages

The plugin hasn't been transalated in any language other than English.

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.