• WordPress changed my featured images after reinstallation by adding the suffix “-1” to the file name in the administration, so the featured images are not displayed. In the uploads folder, the images exist with their original names. How can I change it, fix it? Thank you.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The best solution is probably to restore the DB state to what it was before reinstallation using a backup made before it all started. If that’s not possible, you’ll likely need to directly alter the DB records. It’s likely too much to do manually, you’ll need some kind of automated process. Examine the attachment post records along with their associated meta data via the phpMyAdmin app. Try to determine a way to do a global search and replace operation that would correct all records in one go, or at least only a few goes.

    For example, search for all occurrences of “-1.jpg” and replace with “.jpg” and so on for each file extension. The problem will be with any filenames that legitimately need the “-1”. Hopefully there aren’t any or at least very few of these. Make note of any since you’ll need to go back and manually patch these. You can use the Better Search and Replace plugin for this kind of operation.

    Even though the DB is in an undesirable state, you should make a backup prior to altering the DB since it’s possible to accidentally make things worse instead of repairing.

    Thread Starter Rogner

    (@rogner)

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.