Set all default image insert settings • WordPress Help

So if you want to always use the same customized settings for your attached images, instead of setting them each time, you just have to add the following code to your liking, which you will have to add to your utilities plugin or to the file functions.php of your active theme:

// Custom settings for attached images

function wps_attachment_display_settings () {

update_option ( 'image_default_align' 'left' ) ; // Image alignment

update_option ( 'image_default_link_type' 'none' ) ; // What the image links to

] update_option ( 'image_default_size' 'large' ) ; // Image size


add_action ( 'after_setup_theme' 'wps_attachment_display_settings' ) ; [1 9659044] You just have to change the values ​​of each parameter to indicate the ones you prefer. The possible ones are the following:

Remove or change the default link for the images • WordPress Help

Surely more than once you will have noticed that when you insert an image it appears by default linked to something normally to the last one you linked the previous image or, by default WordPress to the file of the whole image. This is convenient if you always link to the same (file, attachment, URL), and you can always change it, but you can force the default link to whatever you want or anything .

To get it you can address the problem with 4 different solutions, all with the same result. Let's see them …

Always choose manually what each image links to

Before we get into gardens and modify anything to default values, I must remind you that you can always, and should even, review what each image links to when you insert it .

On the right side of the WordPress editor's media loader, in the section called "Attachment Details", at the bottom and before the insert button (come on, that's right there so you do not forget ) You have just the section where to choose what the image will be linked to, and you should always look at this before inserting images.

 link image wordpress

Simply change the destination of the image link and it is already, regardless of the default value.

In addition, WordPress remembers your last choice, so if the last time you inserted an attachment in an entry you linked it to a URL it will be the checked option, or nothing, or to whatever it is, you remember once for another, so it's not a bad option but quite the opposite, in fact you should include this habit of reviewing what your attachments link to before inserting them into your writing routine.

That you do not always control this or there are editors on your site that " pass " from you? then we do not have another that, now, attack with the artillery and force the links by default …

Remove or change the default link to the images from WordPress without code or plugins

Maybe you did not even remember, and that I remind you from time to time but in the WordPress administration there is a hidden settings page where you can change all the settings of your site, both the ones you see in other settings pages like many others that are not normally available to view.

Just go to the hidden administration page, located at and you will see a huge list of possible configurations, actually all the possible ones in your site, but in the rough.

For the case that concerns us today, look for image_default_link_type and you will see a text box where default will show "file", the you default to WordPress, which means that your images link by default to the multimedia file, to the full image.

 change link default image wordpress settings

You can change the default behavior of the links to the images right there, with these options:

  • file: link to the multimedia file, to the complete image.
  • post: link to the entry where the inserted image is.
  • ] attachment: link to the attachment page that WordPress creates.
  • none (or leave it empty): so that by default the images do not link to anything.

Easy huh? And without installing anything or touching a line of code, all there, in your WordPress although a little hidden.

Beware! Since you are on the hidden settings page, you will be curious. You will see things that you recognize and others that do not, do not even touch anything that you do not know exactly what it is or you will load something, okay?

Remove or change the default link to the images with code

If you do not you're afraid of the code, or even like it, you can add these simple lines to your utility plugin or to the file functions.php of the active topic:

In the example you will see that the decision is that you do not link to anything But you can change the value 'none' by your favorite choice (post, attachment, file)

Remove or change the default link to the images with plugins

Of course, you can always use some plugin but this time I assure you that it is not by far the best option, which will always be the first, lighter and painless.

But if you are a total fan of plugins you can use one of these to get it: [19659018] Default Image Link : Simple, you choose your favorite option and it works.

  • No Image Link : It changes the default option to not link to anything, it is activated and ready
  • Yoast SEO : It's not the same, it's a variation of what we're talking about, but Yoast's SEO plugin has an option on the settings page Advanced -> Permanent links or permalinks where you can specify which attachment pages you create r WordPress the images link to the entry to which they belong, much better for the internal SEO.
  •  redirect file link in yoast

    So what is the best way to link the images?

    ] As a final note, since I am asked a lot, in my opinion I think the best thing is that you do not link the images to anything or failing to the input (the option post ]). With this you avoid the hotlinking to a large extent and by the way the search engines will point to your content when they take you traffic.

    Oh, and do not fear, if you dare with these changes, do not take away or change the links of the images that you already had inserted in your entries, simply mark the default behavior for when you are going to insert the following ones.

    Likewise, you can always refer to the first option, zero, to link your images to the What do you want?

    Do you have any doubts? Do you know any other trick? Do you want to say something? Tell us in the comments

    NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

    Loading …

    That may also help you:

    Use Dropbox as a media library in WordPress • WordPress Help

    The WordPress media library is where the images and other files that you upload are stored to attach to your publications , and it works great and all that but there is a big problem that we all face sooner or later: the storage space .

    No matter what type of accommodation you have hired, the storage space in servers is limited and, above all, expensive, very expensive I would say .

    Unlike your computer, where you can buy a hard disk SSD high capacity for less than 200 euros and enjoy it throughout its life, when acquiring disk space in a hosting provider you pay for each month that you use it and in a year you have paid the entire hard disk having used a tenth of its total capacity, it is like that, we do not like it but it's what ay .

     prices hosting web hosting wordpress

    To this we must add that any image that you upload from your server also consumes bandwidth, each mega account and the bandwidth is even more expensive in hosting, so we have a fat fat problem, which has to be solved .

    What do I mean by this? clearly, we have to look for storage alternatives on our website because if we go to upload all our high quality photos, files and others to our accommodation, and if we add that WordPress creates copies (minors) of each image that you upload, because we can soon find ourselves with a problem of storage or of finances .

    One very good would be to be able to use Dropbox as a storage system in the cloud for sure you already have an account with more than 2 Gb of space, which you could use for use it as a space for your WordPress attachments, had you thought about it?

    Also, it is very easy to do . I'm not talking about uploading your photos to Dropbox and linking them in any way by attaching from URL, but integrate your Dropbox storage in WordPress to access your photos of the cloud storage system as if it were your WordPress media library .

    By the way, when loading from Dropbox, do not consume bandwidth from your hired hosting, but from the cloud of Dropbox so the saving, speed in loading your web , and benefit, is double

    I present to you CBX Dropbox File Chooser .

    This gem, once installed, adds a beautiful (so big) button next to that of Add object from which, when pressed lightly, you will see your Dropbox images, which you can choose to insert them in your publication immediately also being able to choose among several sizes to display it in your publication

    The only previous step to enjoy this wonder is connect your WordPress with Dropbox ] creating an application with its API then you copy the code, you paste it in the plugin settings page and it works.

    ] What I said, a jewel.

    What are you waiting for? run to install it now, time runs and money flies .

    NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

    Loading …

    That may also help you:

    Organize files uploaded by user • WordPress Help

    In a WordPress site where there are several users and you want to have a editorial control you will have to add a series of plugins that improve this functionality, because by default you do not have all the control you need.

    We have already seen how manage users in WordPress but there is always one remaining leg: the management of the attachments because in principle any user can access all the attachments but and if we could control that they could only access the files that they have uploaded and not others? . I can think of many writing and publishing environments where this makes perfect sense.

    Thankfully we can use WP Users Media which does just what we need . Once active each user with profile of Author will only see the attachments that he has uploaded and those will be those that he will be able to use to illustrate his publications. Users with more permissions, the Editor and the Administrator of course, will be able to view and use all.

    As you can see, a very interesting solution for is to control the editorial flow in WordPress, also with attachments that's nothing.

    Danger of data loss due to WordPress error

     lost company data

    Imagine the following situation …

    Every month you publish the financial or marketing results of your company , and for that you launch an entry in the corporate blog in which shows the PDF with all the company data of the period in question.

    Well, a curious or malicious visitor could get ahead and have that data before you want to expose them .

    How ?, because in reality is simple, and because of a WordPress error in the management of attachments

    Let me explain …

    When you create a new entry, as long as you do not publish you can leave it in draft, pending review or scheduled, and any administrator or editor preview it previously by Temporary URL or even the permanently, not so any visitor or user without the appropriate permissions, who will get an error even if he knows the URL .

    Let's say, for example, that someone is closely monitoring your publications, because even if he knew the IDs of your last entry and I did random tests, when typing something how I would not have enough permissions to see anything.

    But the same thing does not happen with means that you have uploaded to WordPress, whether or not they are attached to an entry as their URLs are always accessible .

    In this way, if you always raise, say, the financial results with a similar file name structure, the type informe_finanzas_2013-08.pdf would have relatively little trouble finding it and visualizing it if you uploaded it before publishing it something otherwise quite usual, even if it's only hours.

     loss company information

    You just need to guess the full URL of the file upload, which if you follow it usually will not cost you guess, of the type uploads / 2008/08 / informe_finanzas_2013-08.pdf

    This, in sensitive market situations, can be a serious problem facing your investors or competitors. Are you going to get it?

    But is even more serious, because in fact it is even easier to guess the URL of an attachment because you would not even need to know the folder where it is hosted, not even the name of file, but you only need " guess " the attachment ID and that's just trial and error.

    For example, the following file is not associated with any entry, that is, is not published, but nevertheless, and unlike the entries, if you can see it even if you do not have user permissions : .

    I think you should understand that if is a security flaw in the way that WordPress manages the privacy of attachments do you see it?

    I hope soon the way URLs of attachments are managed in WordPress because this is a f allo fool that, in what situations can be a security hole that causes data loss, in some cases important . The solution could happen because only the attachments were accessible when they are associated with an already published entry, not before, for example.

     secure data

    Well there are some. For example, you could manually upload the sensitive information to a different folder than the usual WordPress and then add a rule to the file .htaccess so that no unregistered user can see the files uploaded there, but it's something radical

    In case this helps you, this would be an example of .htaccess standard with the lines in question (5, 6 and 7) protecting the folder " private ", located within your folder " uploads ", so that only registered users can see the files:

    But I already tell you that is a something beast and impractical .

    A less radical and controlled way of offering certain attachments in a more rational way would be to use a plugin that manages file downloads, how WP download manager WP filebase or Easy digital downloads .

    In this way sensitive information will only be offered by downloads managed with the plugin as well as this type of plugins usually offer options so that certain files can only be downloaded with a password or only by registered users, which offers you more possibilities.

    But wow, they are temporary solutions to an existing problem. If you know of any other solution, tell us, okay?

    NOTICE : this publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

    Loading …

    That may also help you: