WP Original Media Path
[resolved] How to automatically change media paths for OLD media? (2 posts)

  1. morespinach
    Posted 3 years ago #

    Love the simplicity of this plugin, but it doesn't seem to be doing what I expect.

    I want my media to be uploaded into a custom folder, which then needs to become a subdomain. Let's say my website is xyz.com.

    The folder is:
    subdomain (which translates into home/xyz/www/wp/subdomain)

    The URL path should be:
    http://subdomain.xyz.com (I have the CDN setup, and this domain works fine)

    Yet, despite this plugin, the file paths for my media are still xyz.com/wp/subdomain etc. What am I missing?

    If I manually change the path in the browser to "subdomain.xyz.com", then the image works. So the uploading is working fine, but the file path conversion is not automatic.

    Thanks for any pointers!


  2. RVOLA
    Plugin Author

    Posted 3 years ago #

    Hello @ morespinach

    Indeed, the plugin modifies the behavior of URL for the media to new media.
    If you want it to be retroactive, it will have to modify the URL of the media in the SQL + media calls in the content articles.

    /!\ Warning!
    The operations described are at your own risk and should be adapted to your environment. I can not be held responsible for breaking your database.

    Please backup your database before!

    1 / Set the WP plugins Original Media Path with the correct URL and path of the file

    2 / log in to your phpMyAdmin to execute the following SQL commands

    3 / operation changes guided media:

    UPDATE XX_posts
    SET guid = REPLACE (guid, 'http://www.old-website.com', 'http://www.new-website.com');
    WHERE post_type = 'attachment'

    4 / operation changes the URL in the content of the articles:

    UPDATE XX_posts
    SET post_content = REPLACE (post_content, 'http://www.old-website.com/wp-content/uploads',' http://www.new-website.com/wp-content/uploads);

    Normally if you have taken precautions and ADAPTED codes to your configuration, the old media have changed accordingly.

    good luck

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Original Media Path
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.