Yes, you can use an external image as a WordPress featured image, but not through the standard “Set featured image” button. You need a plugin or a small code snippet, because WordPress by default only allows images uploaded to your own media library. This article explains the practical methods, the trade-offs, and the safer alternatives so you can decide what fits your site.
Why WordPress Doesn’t Allow It by Default
WordPress stores featured images (also called post thumbnails) as attachments in your media library. When you click “Set featured image,” the editor opens the library and expects you to pick an existing upload. The underlying reason is that WordPress generates multiple resized copies of each image and stores the file paths in the database. If the image lives on another server, WordPress cannot create those sizes, and it cannot guarantee the file will remain available. Hotlinking an external image also means you lose control over its availability and loading speed.
Method 1: Use a Plugin for External Featured Images
The most reliable no-code solution is a plugin. Several free plugins exist that add a field to the featured image meta box where you paste a direct image URL. Popular options include External Featured Image and Featured Image from URL. After installing and activating one, you edit a post, scroll to the featured image section, and paste the full URL (e.g., https://example.com/images/photo.jpg). The plugin saves that URL as the featured image, and your theme displays it normally.
Some plugins also let you import the image into your media library with one click, which is a good middle ground. That way you get the convenience of pasting a URL but the safety of a local copy.
Method 2: Add a Code Snippet to functions.php
If you prefer not to install another plugin, you can add a small function to your child theme’s functions.php file. The following snippet tells WordPress to accept a custom field value as the featured image URL:
function external_featured_image( $html, $post_id, $post_thumbnail_id ) {
$external_url = get_post_meta( $post_id, 'external_thumbnail', true );
if ( $external_url ) {
$html = '<img src="' . esc_url( $external_url ) . '" alt="">';
}
return $html;
}
add_filter( 'post_thumbnail_html', 'external_featured_image', 10, 3 );
Then, when editing a post, add a custom field named external_thumbnail with the image URL. This approach requires a bit of coding comfort and is best done in a child theme so updates don’t wipe your changes.
How to Choose Between Plugin and Code
- Plugins are easier, update automatically, and usually add a user-friendly field. The downside is an extra dependency and potential conflicts with other plugins.
- Code snippets are lighter and give you full control, but you must manage updates yourself and ensure the code is compatible with your theme.
- If you only need this on a few posts, a plugin is fine. If you run a large site with many authors, a code snippet might be cleaner.
Common Problems and How to Avoid Them
The most frequent issue is that the external image breaks when the remote site removes it or changes its URL. You also lose the ability to use WordPress’s built-in image editing tools (crop, resize, rotate) because those only work on local files. Another problem is performance: if the external server is slow, your page load time suffers. Finally, some themes use the_post_thumbnail() with specific size parameters; an external image won’t have those generated sizes, so the browser may stretch or distort it.
To mitigate these issues, always use a direct image URL (ending in .jpg, .png, etc.) and make sure the remote site allows hotlinking. Some sites block hotlinking via their server settings, which would cause the image to not display.
External vs. Local: Which Is Better?
For most sites, uploading the image to your own media library is the better choice. Local images are faster (especially if you use a CDN), you control their availability, and you can use all the editing features. External images make sense only when you are pulling from a trusted source that you know will stay online, such as a partner site or a dedicated image CDN that you own. If you are using external images simply to save storage, consider that WordPress hosting usually includes ample space, and a single image is rarely more than a few hundred kilobytes.
Safety and Licensing Considerations
Before hotlinking any image, check the copyright and licensing. Just because an image appears on the web does not mean you have permission to use it. If you are using a stock photo from a free site like Unsplash or Pixabay, downloading it and uploading to your own library is safer and also improves performance. Hotlinking someone else’s image without permission can be considered bandwidth theft, and the owner may replace it with an offensive or broken file.
Frequently Asked Questions
Can I use a Google Drive or Dropbox link as a featured image?
Not directly. Those links open a preview page, not the raw image file. You need the direct download link that ends with the file extension (e.g., https://drive.google.com/uc?export=view&id=FILE_ID). Even then, it may not work reliably because of redirects. Better to download the file and upload it to WordPress.
Will the external image show up in the media library?
No. The media library only lists files stored on your server. The external image exists only as a URL saved in post meta, so you won’t see it in the grid view.
Does this affect RSS feeds or social sharing?
Yes. Some RSS readers and social platforms fetch the featured image from the URL. If the external image is slow or blocked, your post may appear without a thumbnail. Using a local image avoids this.
Can I use an external image for a WooCommerce product?
Yes, the same methods work for product featured images, but be careful: product galleries and variations often rely on attachment IDs. It’s safer to import the image into the media library for WooCommerce products.
What happens if the external image goes down?
Your post will show a broken image icon or nothing at all. There is no automatic fallback unless you code one. That’s why most experts recommend importing the image locally.
Is there a way to automatically import external images?
Yes, plugins like Auto Upload Images can download external images from post content and add them to your media library. But for the featured image specifically, you’d still need one of the plugins mentioned above or a manual import.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Microsoft Surface Duo: The Foldable Phone Story
- Samsung SM-T813 Hard Reset: Step-by-Step Guide
- Mafia Clash Codes: Real Meanings & Usage
- Remove Programs from Mac: Full Uninstall Guide
- Project Sentinel Morning Digest: Data Stack Failure Alerts
- Best KVM VPS Hosting: Top Picks & Guide