How do I automatically rename images in WordPress

Posted on 2012-08-29
Last Modified: 2012-10-05
I would like to automatically rename images in WordPress according to the title of the article I am uploading them to. Is there a plugin to do this automatically? I am running a multi-site WordPress site and would like this to be default behavior on all sites.
If there isn't a plugin, is there something I can do to the core of WordPress to make this be default behavior?

Thank you.
Question by:DataDudes
    LVL 70

    Expert Comment

    by:Jason C. Levine
    There's a couple of different ways to do this and the method you choose will depend on your comfort level with PHP and WordPress coding.  

    Under no circumstances should you hack the core as the hack will break as soon as WordPress updates.

    The first thing I would try is looking at an older plugin: Upload+

    As it supports renaming of files on upload.  You will have to customize it to get exactly what you want though.  A more recent plugin that renames files (and is more active) is this one:

    I have a feeling that slamming those two together will get you closer to what you want.
    LVL 2

    Author Comment

    Media File Renamer is close, but instead of setting the file name of the file to be the title I give it when uploading, I want the file name to be the title of the post I am uploading to. Upload+ looks like it only date stamps images, which isn't really what I'm trying to do either.
    LVL 70

    Accepted Solution

    In that case I think you might want to look at Advanced Custom Fields instead and sort of bypass the media uploader and plugins that affect it in favor of uploading the file to a custom field.  With a fair amount of extra coding, you should be able to pull the current title and rename it.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
    Wondering how you can get your new website ranking on Google Search so that people find you online?  The answer is Search Engine Optimization (SEO). So how do you Start Ranking a New site with SEO?  Below is a starter guide to get your new website S…
    The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
    The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now