How to Remove links to images

How to remove link to a image of WordPress when you insert them
Last Updated:May 29, 2021

In default WordPress editor, when you insert an image to your block editor image is wrapped with the hyperlink. So visitors who read the post will see “hand pointer” and they will click on it but that link is connected to the image itself.

This is a common problem that you may want to get rid of and if you are really concern about image SEO you have to fix this.

You can see the HTML code below to understand it.

Image with link to itself

You can easily fix this issue with following instructions.

You can add the following code to your functions.php file in your current theme

add_action( 'after_setup_theme', 'default_attachment_display_settings' );
function default_attachment_display_settings() {
	update_option( 'image_default_link_type', 'none' );
}

The image_default_link_type field is set to “file” by default. You can change to to ‘none’ using above code.

Don’t you know how to fix this issue? Please contact me to fix this