Linux 软件免费装
Banner图

WP Original Media Path

开发者 rvola
更新时间 2026年11月24日 23:37
捐献地址: 去捐款
PHP版本: 5.9 及以上
WordPress版本: 7.2
版权: GPL-3.0-or-later
版权网址: 版权信息

标签

media upload path subdomain

下载

1.3.0 1.4.1 1.0.0 1.1.0 1.6.1 1.2.0 1.5.1 2.4.3 3.0.0 2.0.0 2.1.1 2.2.0 2.3.0 2.4.2

详情介绍:

WordPress still stores the location of the uploads folder and its URL, but has hidden these two settings since version 3.5. This plugin brings them back, with safeguards. Install, activate, then open Settings > WP Original Media Path and enter the URL you want. The folder follows. What for? How it works The folder and its URL are easy to mix up: files stored in one place, looked for in another. Here you only enter the URL, and the folder follows. The settings page shows, with your own values, where the files go. On a multisite network, only super admins can change these settings, site by site. Enter URLs from the network 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

安装:

  1. Back up your site (files and database).
  2. Install and activate the plugin, then open Settings > WP Original Media Path.
  3. Enter the new URL and save.
Update the existing media The plugin changes where new files go. Media already uploaded keep their old URL in your content, so on a site that already has media:
  1. Move the content of the old folder to the new one, shown under the field ("File on this server").
  2. Replace the old URL with the new one in the database. With WP-CLI, preview first, then run:
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.

常见问题:

Does it work with a CDN?

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.

Images do not display

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.

On a local copy, my new uploads do not display

That is expected when the URL points to production: files uploaded locally are stored locally.

My site is broken

Empty the URL field and save: WordPress uses its default folder again.

Can I use WP-CLI?

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.

What happens when I deactivate or uninstall the plugin?

Deactivating keeps your settings: WordPress keeps using them. Uninstalling brings back the WordPress default, on every site of a network. Files are never moved.

更新日志:

3.0.0