Libre Software

WordPress: remove links to images

Link symbol imageWordPress default settings are somewhat awkward: if you insert an image (or any picture or media) in a post, the inserted image will link to itself. A visitor who reads your post will see a “hand pointer” when his mouse pointer goes over the image, and he may want to click on the image.

The image link only links to the image itself. This behavior is really problematic, as links should link to something interesting, and should not frustrate the visitor.

Solution 1: set image default link type to ‘blank’ in the hidden WordPress options menu

There are some solutions to remove the automatic link to image files on posts. This WordPress Forum post shows a quite elegant solution using the “secret” WordPress options menu at:

Look for the option ‘image_default_link_type” and change to “blank”. Unfortunately this tuning may be overwritten by future WordPress updates.

Solution 2: set the default link type to none in functions.php

This solution is has the same result as solution 1, but won’t be overwritten by an update. Add the following lines to your theme’s functions.php file:

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

Solution 3: use a plugin to remove image links

If you don’t want to mess up with functions.php, there is a simple plugin well-named “no image link” which will do all this for you.

Solution 4: remove image links in existing posts

Unfortunately, solutions 1 to 3 only works for new posts, all existing posts will stay with their old image links. Try out this script from CFX design to remove image links in existing posts.

  • All
  • Archive
  • Image
  • Linux
  • Linux Server
  • Smartwatches
  • Updated
  • WordPress
How to remove TLSv1.0 and 1.1 and enable TLS 1.3 in Nginx on Ubuntu Server
Linux ServerUpdated

How to remove TLSv1.0 / 1.1 and enable TLS 1.3 in Nginx …

Photo: License: CC BY-SA 4.0 … on Ubuntu 18.04, 20.04 or 22.04 Last updated on September 29, 2022In January 2020, SSL Labs started to …

Read More →

AVIF browser test page: AVIF support in Chrome, Firefox, Edge…

Logo: Alliance for Open Media. License: BSD Last updated on September 29, 2022 Is your browser capable of displaying AVIF images? Here comes a fast answer …

Read More →
LibreOffice installation on Linux

How to install LibreOffice 7.4 on Linux Mint, Ubuntu, MX Linux, Debian…

Last updated on September 27, 2022 This article describes how to install LibreOffice 7.4 on Debian/Ubuntu-based Linux distributions, such as Linux Mint, MX Linux, Ubuntu …

Read More →
How to install Mozilla Firefox on Linux (Ubuntu, Linux Mint or any Linux distribution)

How to Install Firefox 105 on Linux Mint, Ubuntu, Debian or any other Linux distribution

Photo: janeb13 / Pixabay, Pixabay License Last updated on September 27, 2022 This how-to explains how to install Firefox on Linux, with or without replacing an existing …

Read More →
Automatic Updates in Ubuntu Server
Linux Server

How to set up automatic updates on Ubuntu Server 18.04, 20.04 or 22.04

This guide explains how to configure automatic updates in Ubuntu Server 18.04 “Bionic Beaver”, Ubuntu 20.04 “Focal Fossa” or Ubuntu 22.04 “Jammy Jellyfish” This tutorial …

Read More →
Libre Software

Vantage WordPress Theme – Remove the footer

If you run the Vantage theme on WordPress, you’ll notice the “A SiteOrigin Theme” footer. If you want to get rid of it, remove it, …

Read More →
LEMP Tutorial on Ubuntu (How to install Linux, Nginx, PHP, MySQL)
Linux Server

How to install a LEMP stack on Ubuntu Server 18.04, 20.04 or 22.04

Introduction This guide shows how to get a full LEMP software stack installed on Ubuntu Server 18.04 “Bionic Beaver”, 20.04 “Focal Fossa” or 22.04 “Jammy …

Read More →
Screenshot featuring a chameleon installing Virtual Box on a CentOS computer

Install VirtualBox on CentOS / RHEL / Scientific Linux

This how-to is about installing VirtualBox on CentOS. Provided instructions should also work on Scientific Linux and Red Hat Enterprise Linux (RHEL). It is possible …

Read More →

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.