Skip to content

A WordPress plugin that uploads media files to a remote FTP server while preserving Elementor paths and ensuring styles remain functional. Useful for offloading uploads to a download host without breaking site design.

License

Notifications You must be signed in to change notification settings

BaseMax/wp-remote-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Remote Uploader for WordPress

Upload WordPress media files directly to a remote FTP server (like a download host) while preserving Elementor paths and styles. This plugin ensures that media files (e.g., images) are uploaded to a secondary domain (e.g., https://dl.example.com/uploads) while keeping Elementor-generated CSS and assets untouched.

🔧 Features

  • ✅ Automatically uploads new media to a remote FTP server.
  • ✅ Keeps Elementor styles (elementor/css/...) working by excluding them.
  • ✅ Updates media URLs to point to the remote download host.
  • ✅ Automatically creates directory structures on the FTP server.
  • ✅ Deletes the local copy after successful upload to save space.
  • ✅ Cleanly integrated into WordPress's upload_dir and wp_handle_upload hooks.

📂 Directory Structure

Your WordPress media files (e.g., /wp-content/uploads/2025/07/image.jpg) will be served from:

https://dl.example.com/uploads/2025/07/image.jpg

But Elementor-generated files (like /uploads/elementor/css/post-xxxx.css) remain untouched and are loaded from the main site:

https://example.com/wp-content/uploads/elementor/css/post-xxxx.css

🚀 Installation

  1. Upload the plugin folder to your WordPress site's /wp-content/plugins/ directory.
  2. Activate the plugin via the Plugins menu in WordPress.
  3. Define your FTP credentials in wp-config.php (optional, see below).

🛠 Configuration

By default, FTP credentials are hardcoded in the plugin. To secure and externalize them, add the following constants in your wp-config.php:

define('REMOTEUPLOADER_SUBDOMAIN_URL', 'https://dl.example.com/uploads');
define('REMOTEUPLOADER_FTP_HOST', 'ftp.example.com');
define('REMOTEUPLOADER_FTP_USERNAME', 'ftpuser');
define('REMOTEUPLOADER_FTP_PASSWORD', 'ftppass');
define('REMOTEUPLOADER_FTP_BASEDIR', '/domains/example.com/public_html/uploads');

Replace example.com with your actual domain.

✅ Upload Behavior

  • Files uploaded under /uploads/20xx/ are moved to the remote FTP.
  • Elementor-related uploads (containing elementor in path) are excluded.
  • Files are removed from the local server after successful transfer.

🔒 Security Note

Make sure your FTP credentials are kept secure. Avoid committing them to version control. Prefer using wp-config.php as described above.

📄 License

MIT License

👨‍💻 Authors

GitHub: https://github.com/BaseMax/wp-remote-uploader


Happy uploading 🚀

About

A WordPress plugin that uploads media files to a remote FTP server while preserving Elementor paths and ensuring styles remain functional. Useful for offloading uploads to a download host without breaking site design.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages