• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Remove WordPress Post Image Link (Image Link 404 Fix)

By Abhishek Ghosh October 1, 2014 8:06 am Updated on October 1, 2014

Remove WordPress Post Image Link (Image Link 404 Fix)

Advertisement

If you are getting lot of 404 and soft 404 in Google webmaster tools, you can add this snippet to remove WordPress Post image links to solve. There are many weblogs, question answer forums tried to provide a snippet which works for all Theme Frameworks – including Genesis, Thesis, Woo and practically all, but most either never works or stops working after a version update of WordPress. Our Snippet To Remove WordPress Post Image Link (Image Link 404 Fix) Will Work With Any Theme And Forever. This precisely works with Genesis.

 

Remove WordPress Post Image Link (Image Link 404 Fix) : Why and Advantages

 

This falls among best practice for good WordPress websites. Linking to own post or the image is actually meaningless and not informative. We only need the image src HTML output to insert the image. WordPress, unfortunately never provides an effective update with fixes bugs, issues of the old content – in other words, even if there is option to remove WordPress Post Image Link from the newer posts, there is no official way to remove the image links from older posts.

SQL Query is not a great way for full removal, as there can be need in future to get back to older condition within a snap. You should probably read Fix WordPress 404 Errors For Non Existing URLs to understand that – doing a 301 redirection towards the post or somewhere is not good to get rid off 404. Image, simply should not have any link unless you manually insert an image and then link it for definite reason.

Advertisement

---

Remove WordPress Post Image Link Image Link 404 Fix

 

Remove WordPress Post Image Link (Image Link 404 Fix) : The Snippet

 

You will need PHP prey replace function :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
// add to active theme's function.php file
// or child themes function.php file if exists
function google_image_link_void( $content ) {
    $content =
        preg_replace(
            array('{<a(.*?)(wp-att|wp-content\/uploads)[^>]*><img}',
                '{ wp-image-[0-9]*" /></a>}'),
            array('<img','" />'),
            $content
        );
    return $content;
}
add_filter( 'the_content', 'google_image_link_void' );

This snippet will not change anything at backend, you will see post image links while editing the old posts. But this actually filter outs the HTML output. As it runs before W3TC or any Cache Plugin Works, once you have added and checked it from fronted, purge the cache and then clear the Cache. Remove all the post image related 404 from Google Webmasters tool and you will not get the error anymore. Try to hover over this post’s image, there is no link. If we change the snippet in use, we will update the post. We are good consumer of this snippet!

This is a practical way – it will not harm any links on category thumbnail or other images. If you manually change the image class in a post for some reason, obviously you will get the hyperlink working. This does not work (WP Beginner) for current version of WordPress :

Vim
1
2
3
4
5
6
7
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);

Tagged With post links on post wordpress remove , wp page remove old image link

This Article Has Been Shared 235 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Remove WordPress Post Image Link (Image Link 404 Fix)

  • Create an archive page listing of articles in WordPress sorted by date

    This tutorial discusses a method to automatically create an archive page in Wordpress showing all your articles chronologically by dates.

  • 9 types of articles to write in your blog

    When one writes a blog on a regular basis, one of the main challenges is to produce relevant content, unique and interesting to the readers, all this on a regular basis. Here are some ideas about what to write on.

  • Advantage of offering email subscription to blog articles

    In addition to reading your blog, your readers can follow your articles via RSS feeds, but do you offer a subscription via email?

  • 100 Tips for Building and Maintaining a Successful Blog

    100 Tips for Building and Maintaining a Successful Blog is the 2500th article published on this website.Free Infographic is also included so that you print it.

  • Wrongs Done By Self Hosted WordPress Newbies

    Wrongs Done By Self Hosted WordPress Newbies has probably never listed by any Advanced WordPress forum user or Codex user.We frequently find some common errors.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Get Audiophile-Grade Music on Your Smartphone March 25, 2023
  • Simple Windows Security and Privacy Checklist for 2023 March 24, 2023
  • 7 Best Artificial Intelligence (AI) Software March 24, 2023
  • ESP32 Arduino Water Tank Level Monitoring Using Laser ToF Sensor March 23, 2023
  • Exploring the Benefits and Advantages of Microsoft’s Operating System March 22, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Remove WordPress Post Image Link (Image Link 404 Fix)," in The Customize Windows, October 1, 2014, March 25, 2023, https://thecustomizewindows.com/2014/10/remove-wordpress-post-image-link-image-link-404-fix/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT