WordPress Open URL in New Tab programmatically

Today, We want to share with you WordPress Open URL in New Tab programmatically.In this post we will show you Open external links in a new window, hear for How to open external menu links in a new tab with WordPress ? we will give you demo and example for implement.In this post, we will learn about External Links – nofollow, noopener & new window with an example.

WordPress Open URL in New Tab programmatically

There are the Following The simple About WordPress Open URL in New Tab programmatically Full Information With Example and source code.

Free Live Chat for Any Issue

As I will cover this Post with live Working example to develop wordpress gallery open in new tab, so the Setting links to open in a new tab (in WordPress) for this example is following below.

Also Read This 👉   Laravel Fullcalendar Integration Tutorial Example From Scratch

Manually Set the Code A link to Google. Add the following. This will work with any link: A link to Google.

function wpexample_my_custom_script() {

jQuery(document).ready( function($) {
$( “ul#adminmenu a[href$=’https://www.google.com’]” ).attr( ‘target’, ‘_blank’ );

add_action( 'admin_head', 'wpexample_my_custom_script' );

Open WordPress Comment Links in New Tab/Window

function open_links_in_new_tab($text) {
$return = str_replace(‘<a', '<a target="_blank"', $text);
return $return;
add_filter('get_comment_author_link', 'open_links_in_new_tab');
add_filter('comment_text', 'open_links_in_new_tab');

Plugin Name: pakainfo Open New Tabs Links
Plugin URI: https://www.pakainfo.com/
Description: This wordpress best plugin adds simple added target="blank" to the links in main message comments and simple author URL. therefor all the links open in new tab.
Version: 1.0
Author: Jaydeep Gondaliya
Author URI: https://www.pakainfo.com/

function comment_links_in_new_tab($text) {
$return = str_replace('<a', '

Web Programming Tutorials Example with Demo

Read :

Also Read This 👉   How to Define and Call a Function in javascript?


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about WordPress Open URL in New Tab.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.