How to define a remote uploads directory?

IMHO a better approach would be adding the remote server’s directory as a locally mounted directory and use this as wp-content directory. Doing this on the block/filesystem level means that WordPress won’t notice a thing, since it appears to WordPress as normal local directory. You may want to have a look at sshfs in order to mount the directory. Using this has the added benefits of:

  • not having to put your ftp password in file
  • no (slow/unreliable) php code having to act as ftp client
  • no need for ftp an insecure protocol by itself
  • no need for a ftp-server on the remote server
  • no need to change WordPress config

Leave a Comment