In WordPress we can change the default location of the wp-content folder by defining a couple constants in wp-config.php about it here on Codex
So if the structure on the server looks like this:
/root/
1. myblog.tld - its own directory
2. sub.myblog.tld - its own directory
You can use this in your wp-config.php:
define( 'WP_CONTENT_DIR', dirname( $_SERVER['DOCUMENT_ROOT'] ) . DIRECTORY_SEPARATOR . 'sub.myblog.tld' );
define( 'WP_CONTENT_URL', 'http://sub.myblog.tld');
It will change the upload dir to the one above the current root (myblog.tld to sub.myblog.tld). And the content-url will be sub.myblog.tld
Related Posts:
- Different upload directory based on post type in a theme
- Post type specific upload folder in 3.5
- Why “Store uploads in this folder” option is not showing in Media Settings in WordPress
- wp.media add context
- Resize the WP media Uploader iFrame
- Can I stop wordpress generating media sizes
- Display attachments by the ID of the post being edited in the wp.media frame (frontend)
- One step picture upload
- How to change format of file link ( Name ) when insert from media uploder
- Set different max upload size limits based on file type/extension
- Efficient way to move media folder to another folder
- How to display the maximum upload size in a WordPress single site?
- wordpress 3.6 media manager cropping timestamp
- How does WP media uploader create the 3 different sized images, and how can I duplicate it
- Create image formats with different qualities when uploading
- Which filters or actions to use after a media upload and delete?
- wp_delete_attachment doesn’t delete images in wp-content/uploads/
- Force WordPress 3.3 to use Flash uploader
- Protecting direct access to PDF and ZIP unless user logged in (without plugin)
- How to add more upload directories?
- How can I speed up a slow loading media library?
- What to do with unattached logos and header uploaded via native wordpress uploader?
- upload_mimes filter has no effect
- How can you limit the number of images / videos that can be uploaded to a WordPress post
- Failure upgrading / updating site to WordPress 4.7
- Moving Media Library
- Add item to media library from blob or dataUrl
- How do I enable the customize theme page to accept svg’s?
- Frontend Simple Local Avatar upload
- Disable TinyMCE Drag and Drop
- WP3.5 Media Uploader – how to make it accept multiple images?
- How to define a remote uploads directory?
- Looks like image resize is not working well
- resize images not crop
- Trying to add filename over image in Media Browser
- How Can I pass an image file to wp_handle_upload?
- Setting wp_temp_dir and permissions not working for “Missing A Temporary Folder” error
- Allowed memory size exhausted. WordPress side solution
- frontend upload return async-ajax.php 302
- Prevent File Uploads other than images
- How can I upload a file with no extension
- how to change max file upload size WordPress 4.9.8 [closed]
- Media handle sideload not working
- How to overwrite wp_unique_filename logic
- How to change upload directory based on frontend form input name or ID?
- capability for upload on front-end (An error occurred in the upload. Please try again later )
- How to solve: An error occured in the upload
- What function can I use to override the multisite maximum file size upload restriction?
- Cannot upload .mp3 file to wordpress media
- Flatten media files in uploads directory via linux terminal eliminating thumbnails?
- List and show uploaded pdf files dynamically
- WordPress Fancybox Resize Large Image
- WordPress suddenly starts uploading media to an old (backdated) folder
- Delete files uploaded using the wp_upload_bits() function
- XML-RPC: How to add media caption to uploaded image?
- Interface for logged-in users to upload/download files
- wp_handle_upload() does not list uploaded file in the media library?
- wordpress media upload given An error occurred in the upload. Please try again later
- WordPress won’t write in a CIFS drive from himself
- WordPress Media Library – Upload space used
- Local WordPress install plugin wont upload image
- What relationship determines which images appear in ‘uploaded to post’ in edit/add post media dialog
- Disable new WP3.5 Media Picker
- User permissions to upload images
- Why is WordPress’ file upload limit so low? Is changing it harmful?
- How to get the uploaded image url in media_handle_upload()?
- Using dashboard uploader instead of FTP
- Use wp_handle_upload outside of a POST
- admin notice on Insert Media popup screen
- How to allow .bin files upload?
- Add SWF file to wordpress through custom template
- Uploading flash flipbook to mu wordpress site
- Uploaded images result in a file url with full path on disk appended
- Migrating WordPress Uploads To S3 Object Storage
- Upload Video using wordpress rest api with ionic
- download images from wp-content/uploads/year/month/DSC_123.jpg
- SVG not displaying in Media Tab in Backend
- Remove files unrelated to WordPress from uploads
- Images not displaying on site or media library
- Picture upload issue – broken thumbnail
- Hide obj path in source code
- Media not displaying other users uploads – WordPress 4.9.2
- Unable to upload anything to WordPress site
- Uploads from site on Server A uploaded on Server B (Like sort of CDN)
- Creating an Uploads folder with post ID
- I migrated WPMU site: Unable to create directory uploads/… Desperate for help!
- “Could not write file” error in wp_upload_bits function
- Add media button does not insert image in the editor
- How to find out if all enqueued files are uploaded?
- Limit WP Uploader to certain file types only in pages
- Upload Multiple Files With Multiple Fields And With media_handle_upload
- controlling whether upload is attached to post or not
- Attachment Metadata not updated while uploading audio files
- Is it possible to upload files for wordpress importer over FTP?
- how to upload and allow downloads of .mobi and .epub formats
- Auto-Import of WXR File
- how upload images and videos to specific folder like wp-content\uploads\folder-name
- Media upload takes too long
- Problems with defining UPLOADS constant
- Image in binary in the data to WordPress media library