{"id":7915,"date":"2026-04-24T10:07:06","date_gmt":"2026-04-24T08:07:06","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7915"},"modified":"2026-04-24T10:07:08","modified_gmt":"2026-04-24T08:07:08","slug":"wordpress-with-an-external-media-database","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/","title":{"rendered":"WordPress with an external media database"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">By default, WordPress stores all media files (images, videos, and documents) in the <code>\/wp-content\/uploads\/<\/code> directory on your server. For large websites or projects with high traffic, this can lead to performance bottlenecks, exhausted disk space on your <strong>mybox<\/strong> plan, and slower backups.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The solution is an <strong>external media repository<\/strong>\u2014offloading your files to dedicated cloud storage like <strong>Amazon S3, Google Cloud Storage, or Cloudinary<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/#Why_store_images_and_files_off-server\" >Why store images and files off-server?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/#Popular_External_Storage_Configurations\" >Popular External Storage Configurations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/#How_to_redirect_existing_media_links\" >How to redirect existing media links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/#Optimization_Best_Practices\" >Optimization Best Practices<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/wordpress-with-an-external-media-database\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_store_images_and_files_off-server\"><\/span>Why store images and files off-server?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Reduced Server Load:<\/strong> Your <strong>mybox<\/strong> CPU and RAM are no longer used to serve static images, allowing them to focus entirely on processing PHP and database queries.<\/li>\n\n\n\n<li><strong>Seamless Scalability:<\/strong> Cloud storage providers offer virtually unlimited space, so you never have to worry about hitting a disk quota as your library grows.<\/li>\n\n\n\n<li><strong>Faster Page Loads:<\/strong> By combining external storage with a CDN, files are delivered from the server closest to the visitor.<\/li>\n\n\n\n<li><strong>Simplified Migrations:<\/strong> Since your media isn&#8217;t on the local server, migrating your website between environments becomes a &#8220;lightweight&#8221; process involving only the core code and database.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Popular_External_Storage_Configurations\"><\/span>Popular External Storage Configurations<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Amazon S3 (AWS)<\/h4>\n\n\n\n<\/div>\n\n<div id=\"mybox-870400536\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">Amazon S3 is the industry standard for reliable object storage.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Plugin:<\/strong> Use <strong>WP Offload Media<\/strong> or <strong>Media Cloud<\/strong>.<\/li>\n\n\n\n<li><strong>Setup:<\/strong> Create a &#8220;bucket&#8221; in AWS, generate an Access Key and Secret Key, and input them into the plugin. The plugin then automatically syncs every new upload to the Amazon cloud.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Google Cloud Storage<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">A high-performance alternative, especially effective if you are already using Google\u2019s ecosystem.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Plugin:<\/strong> <strong>WP-Stateless<\/strong> is the dedicated tool for this integration.<\/li>\n\n\n\n<li><strong>Modes:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Stateless:<\/strong> Files are stored <em>only<\/em> in Google Cloud (zero local storage used).<\/li>\n\n\n\n<li><strong>CDN:<\/strong> Optimized for delivery via Google\u2019s global network.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. Cloudinary (Media Optimization)<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Cloudinary goes beyond storage by providing real-time image manipulation.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Dynamic Resizing:<\/strong> You can change image dimensions directly via the URL. For example: <code>...\/upload\/w_500,h_300,c_fill\/sample.jpg<\/code><\/li>\n\n\n\n<li><strong>Auto-Optimization:<\/strong> It automatically converts images to modern formats like <strong>WebP<\/strong> or <strong>AVIF<\/strong> based on the visitor&#8217;s browser.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. External FTP\/SFTP Server<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">If you have a separate high-capacity storage server, you can offload media via FTP.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Plugin:<\/strong> <strong>WP Media Folder<\/strong> or <strong>Media from FTP<\/strong>.<\/li>\n\n\n\n<li><strong>Use Case:<\/strong> Best for private clouds or when you want to maintain full control over the hardware without using a public cloud provider.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_redirect_existing_media_links\"><\/span>How to redirect existing media links<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you have already offloaded your files but need to ensure WordPress points to the new source, you can use a filter in your <code>functions.php<\/code> file:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PHP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function mybox_external_media_url($url) {\n    return str_replace('https:\/\/yourdomain.com\/wp-content\/uploads\/', 'https:\/\/cdn.yourdomain.com\/', $url);\n}\nadd_filter('wp_get_attachment_url', 'mybox_external_media_url');\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This code snippet dynamically replaces the local URL with your CDN or external storage URL without permanently changing the database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Optimization_Best_Practices\"><\/span>Optimization Best Practices<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Enable Lazy Loading:<\/strong> Ensure your media only loads when it enters the visitor&#8217;s viewport to save bandwidth.<\/li>\n\n\n\n<li><strong>Use modern formats:<\/strong> Always aim for <strong>WebP<\/strong> conversion to reduce file sizes by up to <strong>30%<\/strong> compared to JPEG.<\/li>\n\n\n\n<li><strong>Implement a CDN:<\/strong> Even if files are on S3 or Google Cloud, a CDN like Cloudflare or Bunny.net ensures the &#8220;last mile&#8221; delivery is as fast as possible.<\/li>\n\n\n\n<li><strong>Keep a local backup:<\/strong> If using &#8220;Stateless&#8221; mode, ensure you have an independent backup of your cloud bucket to prevent data loss in the rare event of a provider issue.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Moving your media off-server is a key step in <strong>infrastructure literacy<\/strong>. It separates your application logic from your static assets, making your <strong>mybox<\/strong> hosted site faster, more secure, and easier to scale. Whether you choose the power of <strong>Amazon S3<\/strong> or the optimization features of <strong>Cloudinary<\/strong>, your visitors will benefit from a more responsive and reliable experience.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[28,58],"manual_kb_tag":[937,6747,8958,8959,8960,8961,8962,8963,8964,8965],"class_list":["post-7915","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-others","manualknowledgebasecat-web-applications-cms","manual_kb_tag-content-delivery-network","manual_kb_tag-cloud-storage","manual_kb_tag-wordpress-external-media","manual_kb_tag-external-media-repository","manual_kb_tag-amazon-s","manual_kb_tag-google-cloud-storage","manual_kb_tag-cloudinary","manual_kb_tag-media-offloading","manual_kb_tag-offload-media","manual_kb_tag-cdn"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7915\/revisions"}],"predecessor-version":[{"id":7916,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7915\/revisions\/7916"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=7915"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7915"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=7915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}