How to remove default image link in wordpress?

Maxwell

New member
Joined
Mar 5, 2013
Messages
397
Points
0
With WordPress it is easy thing to insert images or a gallery into post/page..etc. However, the annoying part is it inserted link to the image automatically when viewers click on the image on front page, it will jump to 1 another window and make us feel annoying.

Why you should disable links to Images in WordPress

Because It can affect your image SEO, Search engines can direct users to the links for the images used instead of your post. Overall, it creates inconvenience for users and affect website Bounce Rate.

One solution to disable the links when inserting images by select none when you are inserting an image in your post as image below.
View attachment 772

How to remove the default link of the image

Other ways are you just need to add the following code to the functions.php file in your directory theme.

Code:
function wpb_imagelink_setup() {
$image_set = get_option( 'image_default_link_type' );
 
if ($image_set !== 'none') {
update_option('image_default_link_type', 'none');
}
}
add_action('admin_init', 'wpb_imagelink_setup', 10);
what is your ways? are there any easier ways better this way? :D
 
Older threads
Replies
2
Views
3,924
bob
  • Locked
Replies
6
Views
4,841
Replies
0
Views
2,644
Newer threads
Replies
6
Views
3,547
Replies
1
Views
2,660
Replies
2
Views
2,778
Replies
2
Views
2,737
Replies
1
Views
5,412
Latest threads
Replies
1
Views
72
Replies
1
Views
87
Replies
1
Views
223
Replies
0
Views
232
Replies
0
Views
253
Recommended threads
Replies
17
Views
7,394
Replies
2
Views
3,301
Replies
1
Views
1,913
Replies
1
Views
2,270
Replies
17
Views
9,828

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top