Family Best Time >> Electronics

How to automatically remove default image links in WordPress

WordPress makes it very easy for you to upload images and create image galleries. However, one really annoying part of adding images to WordPress posts is that it automatically links the image to the media file. You can uncheck this option when adding an image, but sometimes you just forget to uncheck it. In this article, we will show you how to automatically remove default image links in WordPress.

Why you should disable default image links in WordPress

By default, WordPress links images to themselves. A user sees that the image is a link, clicks on it, and is then taken to the image file. From this page, the user has two options:click the "back" button on their browser or go to another site. It's usually the latter. It also affects the SEO traffic of your image because search engines might redirect users to the link used for the image instead of your post. Overall, it creates a bad user experience and affects your site's bounce rate.

One solution is to just select the disable link option each time, but that's not possible because sometimes you just forget.

How to automatically remove default image links in WordPress

Removing the default image link in WordPress

It is very simple to disable the default image link behavior in WordPress. All you have to do is add this code snippet in your theme theme. funciones.php file or in a site-specific plugin.

 función 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); 

Another way to do this is by installing and activating the No Image Link plugin. It works out of the box and there are no options to configure. However, the plugin executes the option on every page, so it's best to just add the code yourself.

Hopefully this will make adding images in WordPress a little less of a hassle, especially if you never link to images. Link to image files on your site? Let us know by leaving a comment below.

Source:Norcross