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

Så här byter du enkelt ut image- och mediafiler i WordPress

Att hålla din websites images högkvalitativa och uppdaterade är viktigt för en professionell och attraktiv online-närvaro. Om du updaterar gamla images eller andra media files kan automatiseringen av denna process save time och få din WordPress website att se bra ut.

Om du aldrig har gjort det förut kan det verka lite knepigt. Men oroa dig inte – du är inte ensam. På WPBeginner har vi hjälpt många användare att bli bättre på att blogga, och vi är här för att hjälpa dig också.

I den här Step-by-Step guiden visar vi hur du enkelt kan ersätta images och media filer i WordPress så att din site alltid ser bäst ut.

Easily replace image and-media files in-post image

Varför byta ut images och media files i WordPress?

Att byta ut bilder och media filer på din WordPress website, om det är produktbilder, featured images eller thumbnails, är viktigt av flera skäl.

Här är några anledningar till varför du bör tänka på att hålla dina media files fräscha:

  • Updated content. Fräscha och relevanta bilder håller din website engagerande och aktuell. De kan också återspegla eventuella förändringar i your business.
  • Förbättrad användarupplevelse. Uppdaterade images av hög kvalitet förbättrar användarupplevelsen. De får besökarna att stanna kvar längre på din site och uppmuntrar dem att utforska fler pages.
  • Fördelar medsökmotorsoptimering (search engine optimization). Optimering av new media files med relevanta keywords kan förbättra deras synlighet i search engines.
  • Bättre prestanda. Om du ersätter outdated eller dåligt optimerade media files med nyare, optimerade kan din website bli snabbare. Snabbare hämtar förbättrar dessutom upplevelsen för användarna och hjälper till med rankingen hos search engines.
  • Konsistens och varumärkesprofilering. Att hålla dina images och media files i linje med din varumärkesidentitet hjälper dig att upprätthålla ett professionellt appearance.

Om du har en website för småföretag visar din publik att ditt företag är aktivt och detaljorienterat om du regelbundet uppdaterar och byter ut dina images och media files. Detta gäller även för personer som runar en online store.

Om du håller ditt mediabibliotek organiserat och uppdaterat blir det dessutom enklare för dig och ditt team att hantera content.

När you vet att alla dina images och media files är aktuella, optimerade och korrekt kategoriserade blir det lättare att hitta och använda rätt filer när det behövs. Detta sparar tid och minskar stressen med att hantera hundratals eller tusentals media files.

Så du kan fokusera på att planera ditt content och skapa högkvalitativa artiklar för din publik.

Med detta i åtanke kommer vi att visa dig hur du enkelt kan ersätta images och media files i WordPress. Här är en snabb översikt över de 3 steg som vi kommer att täcka i den här guiden:

Är du redo? Låt oss komma igång.

Step-by-Step 1. Installera Search & Replace Everything by WPCode

Det första du behöver göra är att installera och aktivera det gratis Search & Replace Everything-tillägget från WPCode.

Vårt team skapade Search & Replace Everything by WPCode plugin för att ta itu med en betydande limit i WordPress: avsaknaden av en built-in hitta och ersätt funktion.

Avsaknaden av denna funktion gav ägare till websites två frustrerande alternativ. För det första kunde de manuellt updating varje page, vilket är tidskrävande. För det andra kan de behöva anlita en utvecklare för att skriva en SQL-sökning, vilket kan bli dyrt.

Search & Replace Everything förenklar denna process genom att tillhandahålla en enkel och kostnadseffektiv lösning för alla som hanterar en WordPress site.

Här är några av tilläggets användningsområden:

  • Byt snabbt ut outdated images på hela webbplatsen med ett enda click.
  • Bulk update av allt content på din websites posts eller pages på några ögonblick.
  • Ersätt enkelt gamla URL:er med nya för att fixa brutna links efter att du flyttat en website.

Den goda nyheten är att du kan använda verktygets gratisversion för att ersätta image- och media-filer. Men om du uppgraderar till Search & Replace pro-versionen kommer du att låsa upp historikfunktionen, där du kan ångra dina ändringar, ersätta images från WordPress block editor, och mer.

Om du behöver hjälp med att installera pluginet kan du kontrollera vår guide om hur du installerar ett plugin för WordPress.

Experttips: Om du redan har WPCode Pro kan du installera och aktivera Search & Replace Everything från WPCode dashboard i WordPress admin area. Allt du behöver göra är att navigera till Code Snippets ” Search & Re place och sedan clicka på knappen ”Install Search & Replace Everything”.

När du har aktiverat kan du komma åt dashboarden för Search & Replace Everything genom att navigera till Tools ” WP Search & Replace.

Du behöver inte konfigurera något, så du kan använda toolet direkt.

WP Search & Replace menu item

Step-by-Step 2. Välj de Images eller Media Files som ska ersättas

För att ersätta images eller media files, låt oss gå till ”Replace Image” tabs i Search & Replace dashpanelen.

I detta area kan du se alla dina befintliga images.

The Replace Image tab in Search & Replace Everything

Nu vill du hitta den fil du vill ersätta.

När du har hittat filen, hoverar du bara musen över den och du kommer att se en knapp märkt Ersätt”. You can give it a click.

The Replace button in Search & Replace Everything

Då kommer du till panelen ”Replace Image”.

You can upload your new file by clicking on the ”Choose a file” button or on the ”Choose a new image to see a preview here” box.

I vilket fall som helst kommer den att redirecta you till datorns lokala disk för att välja en image som ersättning.

The Choose a file button in Search and Replace Everything

När du har valt en fil kommer den att visas i boxen till höger om den gamla imagen.

Om allt ser bra ut, fortsätt och klicka på knappen ”Ersätt källfil”.

The Replace Source File button in Search & Replace Everything

Du kommer då att se ett popup-fönster med en varning som säger att ändringen kommer att vara permanent.

Klicka bara på knappen ”Yes” för att påbörja processen om du är säker på att allt är i sin ordning.

Note: När du byter ut en image kommer andra uppgifter som titeln på media file och alt-texten att förbli desamma. Du kan uppdatera dessa details senare när ersättningsprocessen är completed, men att se till att din nya image eller media file kan använda samma image title och alt text hjälper dig att save tid.

The Yes button in the Are You Sure warning popup in Search & Replace Everything

Därefter kommer Search & Replace Everything att bearbeta ersättningen.

När det är klart ser du ett annat popup-fönster. Här står det ”Image Replace Complete”, följt av några obs/observera.

Du kan klicka på ”OK” för att slutför processen.

The OK button in the Image Replace Complete popup in Search & Replace Everything

Step-by-Step 3. Kontrollera om dina nya images eller media files är Live

You can now visit your posts or pages where this media file was attached and see it replaced with the new file you just uploaded.

Så här gillar vi vår:

Replaced image on a live website

Om du ser den gamla imagen bör du försöka cleara your cache.

För mer detaljerade instruktioner kan du se vår detaljerade Step-by-Step guide om hur du clearar din cache i WordPress.

Fler WordPress Guider för att använda Images på ett effektivt sätt

Vi hoppas att den här artikeln hjälpte dig att hitta ett enklare sätt att ersätta images och media files i WordPress. Du kanske också vill kontrollera vår tutorial om hur du enkelt byter namn på bilder och mediefiler i WordPress eller våra expertval av de bästa plugins och tools för featured image för WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

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.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

31 kommentarerLämna ett svar

  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.

      Administratör

  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

      Administratör

  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.

      Administratör

  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

    • Rehan says

      Please use Regenerate thumbnails plugin to regenerate your images. after that you will see the replaced images.

  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.

      Administratör

      • 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.

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.