What is the best practice for renaming WordPress media files?

As Rarst has explained, you can’t really directly edit your database, or you’ll risk killing the serialized data.

Your options are thus to:

  • delete the file and re-upload it with its new name (obviously has the downside of having to reinsert it everywhere it was being used), or to
  • use one of the media renaming / replacing plugins, which through one method or another take care of updating all links to the file.

If your concern is having yet another plugin installed, you can always sit it there deactivated and just activate it when you need it. I use this for a variety of media “tool” plugins, because I only really need them once in a while.

Leave a Comment