The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. How do I test images in WP migration without Changing URLs?

    How do I test images in WP migration without Changing URLs?

    Intermediate & Advanced SEO
    4 2 115
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kimmiedawn
      kimmiedawn last edited by

      I'm redesigning example.com on a subdomain of my own site, so at example.mysite.com. As part of the redesign, I am optimizing the site's images. I used Wordpress Importer to get the content to the development site, but I did not import the images. Instead, I added the images to the development site by copying and moving over the contents of example.com's uploads folder. The posts at example.mysite.com are showing the images, but they are pulling them from the original location. I tried adding the following code to wp-config.php under the (misunderstood?) impression that the image URLs would use the development site's domain:

      1 define('WP_HOME', 'http://example.mysite.com');
      2 define('WP_SITEURL', 'http://example.mysite.com');

      I am not seeing any change and the images are still pulling from the original site. How can I test the images on the current site without actually changing the URLs in the database. (If I understand correctly, I could search and replace, but that is not what I am trying to achieve.) The original domain is not changing with the redesign, so there is no need to actually change the URLs. I just need to test the images, as I will be removing those that are not being used as well as optimizing the remaining images before moving the redesigned site over to the original domain.

      1 Reply Last reply Reply Quote 0
      • WilliamKammer
        WilliamKammer last edited by

        It sounds like the URLs being used in the code aren't dynamic. There are two different ways to embed an image (and it's URL) on a page with html:

        You can use a dynamic URL, where the domain will be whichever domain the page is on, like notice how there is no domain in front of the URL path, this means the domain will change depending on which website the code is on.

        The other way, and the way it sounds like is being used on your site is This makes the URL definite, since all of it is defined. If you see that your images were put in with URLs like these, you'll need to make them dynamic to accomplish what you want to.

        1 Reply Last reply Reply Quote 1
        • kimmiedawn
          kimmiedawn last edited by

          I appreciate your response. I do not need to permanently change the urls, as the domain is not changing in the redesign. I just need to see that all the images I have edited are in place correctly on example.mysite.com. There must be a temporary/test solution.

          WilliamKammer 1 Reply Last reply Reply Quote 0
          • WilliamKammer
            WilliamKammer @kimmiedawn last edited by

            If the images are coded into the website using "http://example.com/image.jpg" instead of "/image.jpg" then the images will always pull from example.com, instead if your test site.

            If they were coded with "/image.jpg" then the code would pull from example.com when the page was there, and example.yoursite.com when you moved it over for testing.

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post
            • When the site's entire URL structure changed, should we update the inbound links built pointing to the old URLs?
              BlueprintMarketing
              BlueprintMarketing
              1
              6
              102

            • Would changing the file name of an image (not the alt attribute) have an effect of on seo / ranking of that image and thus the site?
              DirkC
              DirkC
              0
              4
              5.6k

            • Image URL Change Catastrophe
              wantering
              wantering
              0
              3
              110

            • Does having a trailing slash make a url different than the same url without the trailing slash?
              webestate
              webestate
              0
              4
              2.2k

            • Overly-Dynamic URLs & Changing URL Structure w Web Redesign
              Marcus_Miller
              Marcus_Miller
              0
              2
              257

            • Can changing dynamic url of over 2000 pages site after a year will change its ranking
              KevinBudzynski
              KevinBudzynski
              0
              3
              388

            • Changing Site URLs
              GCSMasone
              GCSMasone
              0
              5
              446

            • We are changing ?page= dynamic url's to /page/ static urls. Will this hurt the progress we have made with the pages using dynamic addresses?
              h3counsel
              h3counsel
              0
              3
              806

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy