Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coupe WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Comment remplacer facilement les fichiers d’images et de médias dans WordPress

Note éditoriale : Nous percevons une commission sur les liens des partenaires sur WPBeginner. Les commissions n'affectent pas les opinions ou les évaluations de nos rédacteurs. En savoir plus sur Processus éditorial.

Avez-vous déjà essayé de remplacer une image que vous avez téléversée dans WordPress ? Si c’est le cas, vous avez probablement dû téléverser un nouveau fichier, le renommer et l’insérer dans la publication tout en remplaçant l’ancien fichier. Maintenant, ne serait-il pas agréable si vous pouviez faire tout cela en quelques clics ? Dans cet article, nous allons vous afficher comment remplacer facilement les fichiers joints dans WordPress.

Tutoriel vidéo

Subscribe to WPBeginner

Si vous n’aimez pas la vidéo ou si vous avez besoin de plus d’instructions, alors continuez à lire.

La première chose que vous devez faire est d’installer et d’activer l’extension Enable Media Replace. Une fois activé, il fonctionne hors de la boîte, et il n’y a pas de réglages pour vous à définir.

Tout ce que vous avez à faire est de visiter Media  » Bibliothèque dans votre zone d’administration WordPress. Si vous utilisez la vue grille, vous devez passer à la vue liste.

Maintenant, localisez le fichier que vous voulez remplacer. Une fois que vous avez trouvé le fichier, placez votre souris près du nom du fichier, et vous verrez un lien libellé ‘Replace Media’.

Replace media link in the media library

Lorsque vous cliquez sur ce lien, vous accédez à la page de remplacement des médias. Là, vous devez téléverser votre nouveau fichier en cliquant sur le bouton Choisir un fichier.

Une fois le fichier choisi, deux options s’offrent à vous. Vous pouvez choisir de remplacer uniquement le fichier ou de remplacer le fichier, d’utiliser le nouveau nom de fichier et de mettre à jour tous les liens pointant vers l’ancien fichier.

Après avoir choisi l’une des options, il vous suffit d’appuyer sur le bouton Téléversement.

Replacing old file by uploading new media

WordPress va maintenant téléverser votre fichier média, et l’extension va remplacer l’ancien fichier média. Si vous avez choisi d’utiliser un nouveau nom de fichier et des liens de mise à jour, l’extension s’en chargera également.

Vous pouvez maintenant visiter vos publications ou pages où vous aviez ce fichier média joint et voir qu’il a été remplacé par le nouvel outil que vous venez de téléverser.

Nous espérons que cet article vous a aidé à trouver un moyen plus facile de remplacer les fichiers joints dans WordPress.

Si vous vouliez simplement renommer des fichiers multimédias, alors vous pouvez consulter notre tutoriel sur la façon de renommer facilement les images et les fichiers multimédias dans WordPress.

Si vous avez aimé cet article, veuillez vous abonner à notre chaîne YouTube pour obtenir des tutoriels vidéo sur WordPress. Vous pouvez également nous trouver sur Twitter et Google+.

Divulgation : Notre contenu est soutenu par les lecteurs. Cela signifie que si vous cliquez sur certains de nos liens, nous pouvons gagner une commission. Consultez comment WPBeginner est financé, pourquoi cela compte et comment vous pouvez nous soutenir. Voici notre processus éditorial.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

L'ultime WordPress Toolkit

Accédez GRATUITEMENT à notre boîte à outils - une collection de produits et de ressources liés à WordPress que tous les professionnels devraient avoir !

Reader Interactions

31 commentairesLaisser une réponse

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Phil says

    Is there a way to batch replace? I’m a photographer and sometimes have over 100 images per blog post. I wanted to replace them with smaller file sizes to help with my pages speeds. Is this possible?

    Many thanks

  3. Jeff Vetterick says

    If I use the plugin to just « replace image only » (with one of the same file name) will the alt text, image description, and image caption of the original image be overwritten or preserved. If they are preserved, this would save me a ton of time.

    • WPBeginner Support says

      It should keep that information if it is able, you would want to reach out to the plugin’s support for specifics.

      Administrateur

  4. jg says

    This option isn’t available in the new version as it just allows you to delete or edit it. if I delete it I don’t know the url to replace it with?

    • WPBeginner Support says

      You may want to ensure you are in the correct view for your media library as the feature is currently available

      Administrateur

  5. Sanjay Sajeev says

    Thank you for your post.

    I installed enable media replace plugin in my site. But when I replace an image that I used in a blog post, I can see the image has been replaced in the media library. But When I check that image in the blog post, there is no change to that image and its file size. What I have to do to resolve this?

    • WPBeginner Support says

      You may want to try clearing your cache and if that does not work, reach out to the plugin’s support for them to take a look at possible issues.

      Administrateur

  6. Fede says

    Hi. I keep getting request timeout. Same as when uploading using usual wp means. That is why I had to switch to uploading via ftp and then loading them through a plugin meant for that. I really need to get this working since some of the images are not scaling properly nd need to change them. Any help would be apreciated. Thanks.

  7. hitesh says

    Hi

    in my wordpress admin there is no any option like replace media..in mine there are only 3 options 1) EDIT 2) DELETE PREMANENTLY 3) VIEW

    So what is the issue there ..its old version or have any other issue can u please clear that so that i can replace that media files

    Regards
    Hitesh

  8. Nicole says

    Help

    I’m a perfrormer contacting agents and tried to replace voice reels after successfully installing yourplugin ( thought it was safest way to go )
    Now htey are blanks – I’ve cleared browsing cache

    I followed the instructions
    my media player is this :

    svnlabs HTML5 Mp3 player 3.6 installed

    please help :0

  9. Riccardo says

    Hi thanks for the article, the plugin works great. There’s one thing I don’t get though: the image replacement seems to only affect the image in its original size, when the site displays the image in other formats (thumbnails, previews, etc…) I can still see the old image file.
    How can I force the image replacement on all the other image files (e.g. imagename-300×200.jpg)?
    thank you

  10. Panagiotis Tabakis says

    The Enable Media Replace plugin poses a security threat, I would totally avoid it. Its a shame to suggest users to use dangerous software. Please research before posting.

    The exploit holds since 2011.

    For more info see

    • WPBeginner Support says

      Hi Panagiotis,

      The issue was immediately resolved by the plugin author in the very next release (please see plugin’s changelog and scroll down to version 2.4).

      This is why we recommend users to keep their WordPress site and plugins updated.

      Administrateur

      • Panagiotis Tabakis says

        Yes, you are correct. I’m sorry, I saw a support post which the plugin author didn’t answer and thought it wasn’t resolved.
        The exploit was patched @ 09 February 2011 (the same day).

        I wonder why the author hasn’t replied but I will inform the forum users.

        Again, sorry.

  11. Blake says

    I am running WP 4.6.1 bootstrap and I want to remove a background photo and replace it with one that is in my galley. Can you tell me how to do it, Thanks

  12. Sky says

    I followed the steps and in the library the new image is displayed but where the image is located on the home page remains the old photo. Not sure what to do…

    • Christian Scholz-Flöter says

      Maybe it’s a browser cache related issue and you need to clean/delete the browser cache. If you don’t know how to do it, google your browser’s brand name and « clear browser cache ».

  13. jorge says

    This plugin works great in the media page. However I would like to also replace images/media from within the media modal window inside a post/page edit page without leaving the page. Any ideas?

    Thanks for this amazing post!

  14. Marilyn says

    I wish I had known this sooner! I didn’t detach my media files before I deleted them. I replaced them with a new image. The problem is that resulted in broken images. Even though I go back and reattach/choose the correct image down the road it breaks again. In my Easy recipe program I see the placeholder for the deleted image and the program searching for it. Is there a fix for this? Unfortunately there are about 200 files doing this.

Laisser une réponse

Merci d'avoir choisi de laisser un commentaire. Veuillez garder à l'esprit que tous les commentaires sont modérés selon notre politique de commentaires, et votre adresse e-mail ne sera PAS publiée. Veuillez NE PAS utiliser de mots-clés dans le champ du nom. Ayons une conversation personnelle et significative.