WordPress 4.7.4 and the ‘noopener noreferrer’ attribute

Some of you may have noticed that after you upgrade to WordPress 4.7.4, when you edit a post using the visual editor tab and add an internal link (a link… More »

Spread the love

Some of you may have noticed that after you upgrade to WordPress 4.7.4, when you edit a post using the visual editor tab and add an internal link (a link to another page or post on your site) with a target=”blank” attribute, WordPress’s TinyMCE editor adds the following attribute to the link:

rel=”noopener noreferrer”

This has been touted as a security measure but for many people it is seriously messing up their referral tracking and analytics.

Fortunately it’s easy to disable, simply by adding the following code to your theme’s functions.php file (if you’re using a child theme, add it to the functions.php file in the child theme, not the parent theme).

function my_tiny_mce_before_init($mceInit) { $mceInit['allow_unsafe_link_target'] = true; return $mceInit;
}
add_filter('tiny_mce_before_init','my_tiny_mce_before_init');

So if you don’t want this attribute to be added by WordPress, you now have a way of removing it.

Share Button
Facebook Comments

More Stuff

How to install LXD container hypervisor on Ubuntu 16.04 LTS nixCra... How do I install LXD container “hypervisor” to runs unmodified Debian/Ubuntu/CentOS Linux operating systems VM at incredible speed on a Ubuntu Linux ...
Living on the command line: Why mistakes are a good thing Failure = Freedom. Is that really true? For many organizations, it is. These groups of developers... or marketers or educators... are applying the bel...
piwheels: Speedy Python package installation for the Raspberry Pi One of the great things about the Python programming language is PyPI, the Python Package Index, where third-party libraries are hosted, available for...
How to Install LAMP (Linux, Apache, MariaDB and PHP) on Fedora 23 ... If you ever wanted to host your own website or just want to try your PHP programming skills, you will most definitely have stumbled upon LAMP. For tho...
Spread the love

Posted by News Monkey