• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WriteNowDesign - Wordpress and Ecommerce Website Design

WordPress, Joomla, Ecommerce Website Design

  • Home
  • Prices/Packages
  • WordPress
  • Services
  • Portfolio
  • Blog
  • About
    • Testimonials
    • Locations
    • Online Payment
  • Contact
  • Show Search
Hide Search

Call 303-907-6133 Email

WordPress Attachment Image Settings

Change WordPress Default Image Alignment and Link Type

May 6, 2014 by Pat Fortino

When you upload images to WordPress using Add Media, WordPress automatically links to the image file. What that means is that when you insert the image, there is a link to the original version of the image you just inserted. If the user clicks that image, WordPress replaces the current page with a page displaying the image. Of course, you can easily override this setting each time you insert an image, but there’s is an easy way to change the default setting to no link.

To change the default WordPress image link setting

  1. Log into WordPress admin.
  2. After you are logged into the WordPress admin, paste the following URL in your browser URL field: http://yoursite.com/wp-admin/options.php

    WARNING: Do not change any other settings on this screen unless you know what you’re doing.

  3. Search for the following text: image_default_link_type
  4. In the field next to image_default_link_type, enter none

Bonus: Change the default WordPress image alignment setting

  1.  Search for the following text: image_default_align
  2. In the field next to the image_default_align, enter none

For the Adventurous

If you are comfortable editing your theme’s functions.php file, you can use the following code to modify the WordPress default image settings:

/*
Change the default image settings
*/
add_action( 'after_setup_theme', 'wnd_default_image_settings' );
function wnd_default_image_settings() {
	update_option( 'image_default_align', 'left' );
	update_option( 'image_default_link_type', 'none' );
	update_option( 'image_default_size', 'large' );
}

Default Settings

  • image_default_align: left, right, center, none
  • image_default_link_type: media file, attachment page, custom URL, none
  • image_default_size: thumbnail, medium, large, full-size

That’s it. Now, when you insert a new image, it will have the default settings you prefer.

Filed Under: Wordpress How To 1 Comment

Previous Post: « Add Retina Logo to a Genesis Template
Next Post: Review: WP Responsive Menu »

Reader Interactions

Comments

  1. DrLightman says

    February 10, 2019 at 2:19 am

    Doesn’t work in my WP 4.9.9

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

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

Related

Primary Sidebar

Blog Categories

Call Today

Get a Free Quote

303-907-6133

Subscribe to News

News about WordPress, WooCommerce, & Technology

What’s New

  • WPForms Not Sending Notifications
  • Add Terms and Conditions WooCommerce
  • Fix WordPress AMP Validation Errors
  • Use the Classic Editor with Gutenberg Block Editor
  • Add a Message at Top or Bottom of WooCommerce Checkout Page
  • How to Link to a PDF in WordPress

Find Us On…

  • Facebook
  • LinkedIn
  • RSS

Call 303-907-6133 Email

© 2004–2023 · WriteNowDesign · Sitemap · Log in · Return to Top