• Problem solving – verse 23 – Environment?

    Q. Have you ever wondered why your images are broken after cloning your WordPress site’s database and copied the latest folders from wp-content/uploads?

    A. There’s a simple answer. You didn’t copy all of the latest images.

    Problem solving – verse 23

    And regarding the data,
    you'll think that I'm a chump
    "but does it work on Windows
    running last Wednesday's dump"?


    It’s very easy to get broken images in WordPress.

    1. Export your production database
    2. Import your production database into a local development environment
    3. Update wp_options to make it work
    4. Forget about copying the attached media files

    To resolve this issue you copy the attached media files from the latest months’, so that your directory structures match.

    Sorted? Not quite.

    You may have missed some images that were uploaded recently but are not where you might have thought they should have been.

    • Here we see a broken image in my local copy of oik-plugins.com
    • This new image was uploaded in October 2014
    • But the post that it was attached to (the oik themes server plugin) was originally created in July 2013
    • So WordPress put the newly attached media file in the 2013/07 folder
    • And since my previous database clone was more recent than July 2013 I didn’t clone the uploads folder

    Techniques for future consideration

    It won’t just be media files that are out of date; there’s plugins and themes and even WordPress core that may be different. So it makes sense to take a full backup of the files as well.

    Alternatively, when adding a new media file to an existing post, use this process:

    • Use Media > Add New to upload the file
    • Attach the file to the post
    • Edit the post to make the changes required to refer to the new file
    • And if necessary, delete the file(s) that the new file replaces.

    Suppose you have some content that is valid from a certain date. It would look odd if it appears to have been stored in the system earlier than it was created. And maybe you should also consider displaying the Last update date for your main content.

    This is a good idea for date sensitive files such as a Statement of Professional Standing, Newsletters attached to a Newsletters page, or banner images for new versions of plugins 🙂

    Further reading



    Last updated:

    November 3, 2019


Tide times from tidetimes.org.uk

Tide Times & Heights for Langstone Harbour on
28th March 2023
04:31 High Tide ( 4.23m )
09:38 Low Tide ( 1.66m )
16:58 High Tide ( 4.06m )
21:59 Low Tide ( 1.94m )

Tide times from tidetimes.org.uk

Tide Times & Heights for Northney on
28th March 2023
04:51 High Tide ( 4.02m )
09:45 Low Tide ( 1.26m )
17:24 High Tide ( 3.79m )
22:09 Low Tide ( 1.6m )
WordPress version:6.1.1
Gutenberg version:15.2.0

Summary file