Wordpress

Set Images URL to Default “Link None” In WordPress Post Editor

Written by Wamiq Ali

How many times you hated the WordPress linking up your added images in the post to the url of that image. I really hate that, because it doesn’t give a good experience to the user since once a user is browsing your post and then he clicks any image then he is taken to some url of that image, i-e either to the direct url of the media or else the new single post layout of WordPress media items. There are a lot of solutions for this, one is to just remove the link while editing the post, but every new images which you upload comes with anchor tag which is indeed quite disturbing. So, if you want to remove the image anchor permanently while uploading any pictures to your WordPress blog then kindly follow this guide.

Screen Shot 2014-07-11 at 2.47.25 am

The Real Problem While Adding Images and Setting their Links to None:

The real problem which everyone faces in case of images url while uploading images to WordPress is that “Once you upload image, you can set the dimensions, the float layout and the anchor tag i-e the link which is going to be linked with that image”, but what if you are going to upload hundred pictures ? Then you can’t edit everyones link to make it appear as without link in the single post page. Then here comes  handy solution to make the image link to nothing by default for every media item or image which you upload in your WordPress blog.

Making Your Uploaded images link to nothing in WordPress Post Editor by Default:

You just need to have a good text editor or I may say code editor, because this time you need to add a smart function inside your functions.php file to get rid of this linking up images problem. The process to set images url link to nothing by default is as below:

1- Login to your dashboard of the WordPress self hosted blog which you own.

2- Go to Appearance >> Editor. Navigate to the functions.php file since this is the file which we need to edit.

3- Scroll down to the end of this file , since the function which I need you to add , to set all images url to none while uploading in WordPress must be added inside the functions.php

4- Copy the below code:

function tow_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', 'row_imagelink_setup', 10);

5- So , After you have added this piece of code, now your image default link type will be set to none. You must save the functions.php for that click on update, and then move to your posting editing interface in WordPress. There just click on add media and then upload a new image, You’ll notice that by default the image is linked up to nothing and there isn’t any link associated with images.

About the author

Wamiq Ali

Programmer, Blogger and an Entrepreneur trying to make this web a better place by making others learn for free.

Leave a Comment