| 开发者 | rvola |
|---|---|
| 更新时间 | 2026年11月24日 23:37 |
| 捐献地址: | 去捐款 |
| PHP版本: | 5.9 及以上 |
| WordPress版本: | 7.2 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
https://media.example.com.https://example.com/media instead of wp-content/uploads.https://www.example.com/wp-content/uploads): images show up without downloading the uploads folder.https://example.com/media stores files in the media folder at the root of your site. Nothing else to set up.https://media.example.com keeps the files in wp-content/uploads: point the subdomain to that folder. With a path (https://cdn.example.com/media), the media folder is created at the root of your site: point the domain to that root.https://example.com/media, even for https://example.com/site-b). WordPress adds /sites/ID to the folder and URL of each sub-site, so two sites never share a folder.
GitHub | Donate
wp search-replace 'https://example.com/wp-content/uploads' 'https://example.com/media' --dry-run
wp search-replace 'https://example.com/wp-content/uploads' 'https://example.com/media'
WP-CLI also updates serialized data (widgets, page builders). On a multisite network, add --network.Yes with a "pull" CDN, which copies the files from your site: enter the CDN URL. No with a storage service (Amazon S3…) that files must be sent to: WordPress always stores uploads on this server.
Under the field, the example shows the URL of an image and its file on this server: that URL must open that file. Check that the folder is writable and, for another domain, that it points to the folder shown on the page.
That is expected when the URL points to production: files uploaded locally are stored locally.
Empty the URL field and save: WordPress uses its default folder again.
Yes, with the core options: wp option update upload_url_path 'https://media.example.com' and wp option update upload_path 'wp-content/uploads'. The values are then used as they are, as in expert mode.
Deactivating keeps your settings: WordPress keeps using them. Uninstalling brings back the WordPress default, on every site of a network. Files are never moved.
wp-content anymore.