All external links in your published posts
Jan 1, 2024 4:09:49 GMT -7
Post by account_disabled on Jan 1, 2024 4:09:49 GMT -7
Acode snippet to your themes footer.php file before the body and HTML closing tags to automatically open external links on your site in a new window Source Copy and paste the following code before the body and HTML closing tags. script typetextjavascript CDATA jQuerydocument.readyfunction a.eachfunction var a new RegExp window.location.host if a.testthis.href this.clickfunctionevent event.preventDefault event.stopPropagation window.openthis.href blank script Once you save your changes and pages will open in a new tab. This code will also work for new posts and pages.
This code does not work for internal links or for links in comments or text widgets however. If youd like to set all links anywhere on your site to open in new tabs then you can use a plugin. WordPress Plugins to Automatically Open External Links in a New Window Digital Marketing Service Plugins are the fastest and most flexible option for setting links to open in a new tab or window. Lets look at two options below. External Links in New Window New Tab External Links in New Window New Tab by WebFactory Ltd is a free WordPress plugin that automatically sets all external links to open in a new window. It begins working as soon as you install and activate it.
There is a settings page for turning the functionality on or off for specific links if you want more control. In the External Links in New Window New Tab plugin setting you can turn the autosetting on and off for specific links Source External Links nofollow noopener new window For more control in configuring your link settings you can use External Links nofollow noopener new window. This is another free plugin by WebFactory Ltd. After installing and activating this plugin you can set different options for external and internal links in your WordPress dashboard. You can display an icon after external links to indicate to readers which links are pointing to other websites. It may look like this in your published.
This code does not work for internal links or for links in comments or text widgets however. If youd like to set all links anywhere on your site to open in new tabs then you can use a plugin. WordPress Plugins to Automatically Open External Links in a New Window Digital Marketing Service Plugins are the fastest and most flexible option for setting links to open in a new tab or window. Lets look at two options below. External Links in New Window New Tab External Links in New Window New Tab by WebFactory Ltd is a free WordPress plugin that automatically sets all external links to open in a new window. It begins working as soon as you install and activate it.
There is a settings page for turning the functionality on or off for specific links if you want more control. In the External Links in New Window New Tab plugin setting you can turn the autosetting on and off for specific links Source External Links nofollow noopener new window For more control in configuring your link settings you can use External Links nofollow noopener new window. This is another free plugin by WebFactory Ltd. After installing and activating this plugin you can set different options for external and internal links in your WordPress dashboard. You can display an icon after external links to indicate to readers which links are pointing to other websites. It may look like this in your published.