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 ansluter du Google Drive till ditt mediabibliotek i WordPress

Undrar du hur du ansluter Google Drive till ditt mediabibliotek i WordPress?

När du har gjort anslutningen kan du komma åt alla dina images, foton och filer från Google Drive direkt från WordPress dashboard. Detta kan spara tid och ansträngning och är också ett bra sätt att dela filer med andra WordPress användare utan att dela ditt Google password.

I den här artikeln visar vi dig hur du enkelt ansluter Google Drive till ditt WordPress mediabibliotek.

How to connect Google Drive to your WordPress media library

Varför ansluta Google Drive till ditt mediabibliotek i WordPress?

Google Drive är ett av de mest populära gratis tools från Google och är ett utmärkt sätt att lagra och dela alla typer av filer, inklusive images.

Om du regelbundet uppladdar images till Google Drive kan du spara tid och arbete genom att ansluta ditt Google Drive account till mediabiblioteket WordPress.

Du kan sedan komma åt alla images i ditt Google Drive-konto direkt från WordPress dashboard.

How to connect Google Drive to the WordPress media library

Med denna integration på plats kan du add Google Drive images till vilken page eller post som helst med ett click på en knapp.

Hanterar du en WordPress blogg med flera författare eller godkänner du gästbloggar?

Om du delar WordPress dashboard med andra personer kan du genom att ansluta Google Drive till WordPress allow delning av images och filer utan att dela ditt password till Google.

Detta hjälper till att hålla ditt Google account säkert och gör det enklare att låsa ut personer från din Google Drive när de inte längre behöver tillgång.

Med detta sagt, låt oss se hur du kan ansluta Google Drive till ditt WordPress mediabibliotek.

Så här ansluter du Google Drive till ditt mediabibliotek i WordPress

Det enklaste sättet att ansluta Google Drive till WordPress är genom att använda JoomUnited WP Media Folder Cloud Addon Google Drive Integration.

Detta plugin och addon allow you to access Google Drive files from the WordPress media bibliotek. You kan också skapa foldrar och organisera filerna i ditt Google account.

Du kan se vår detaljerade WP Media Mapp recension för att lära dig mer.

Konfigurera tillägget WP Media Folder

Det första du behöver göra är att installera och aktivera pluginet WP Media Folder. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett WordPress plugin.

Efter aktivering kommer du att se Setup Wizard. För att komma igång klickar du på knappen ”Fortsätt till miljökontroll”.

How to check your WordPress environment

Efter en stund visar WP Media Folder information om din WordPress-miljö, t.ex. PHP-version och Extensions.

För att fortsätta, klicka på knappen ”Fortsätt”.

Connecting Google Drive to the WordPress media library

Du kan nu välja om du vill inaktivera funktionerna gallery och lightbox.

Dessa funktioner allow you to create, edit, and delete folders inside the WordPress media library, så vi rekommenderar att du låter dem vara aktiverade.

Configuring the WP Media Folder WordPress plugin

När du har gjort det klickar du på knappen ”Fortsätt”.

Du kommer nu att se några utvalda funktioner som du kanske vill använda. Standardinställningarna bör fungera bra för de flesta WordPress-webbplatser, men du kan aktivera de ytterligare funktionerna med hjälp av deras toggles.

Om du t.ex. använder en page builder från WordPress kan du aktivera funktionen ”WP Media Folder on front-end”.

När du är nöjd med Settings klickar du på ”Continue”.

Enabling extra features in a WordPress plugin

Efter några ögonblick kommer du att se följande message: ”You have now completed the plugin quick configuration.” (Du har nu completed snabbkonfigurationen av plugin).

När du är klar klickar du på knappen ”Go to Media Library”.

How to connect WordPress to your Google Drive

Installera WP Media Folder Cloud Addon

Därefter måste du installera och aktivera WP Media Folder Cloud addon. Du kan installera detta addon på samma sätt som du installerar ett WordPress plugin.

WP Media Folder har en automatisk connector som allow you att länka WordPress till Google Drive utan att skapa ett projekt i Google Cloud Console. Av den anledningen rekommenderar vi att du använder den automatiska kopplingen.

Men om du inte kan använda anslutningen visar vi dig hur du ansluter till Google Drive manuellt i slutet av den här guiden.

För att ansluta Google Drive till ditt WordPress mediabibliotek måste du gå till Settings ” Allmänt.

Connecting a website to your Google Drive account using a WordPress plugin

Här rullar du till sektionen ”Joomunited live updates”.

Klicka sedan på ”Link my Joomunited account”.

Connecting WordPress to your Joomunited account

I popupen som visas skriver du in email och password för ditt JoomUnited account.

Efter det klickar du bara på ”Logga in”.

Connecting WordPress to a Google Drive using your JoomUnited account

Nu är du redo att ansluta Google Drive till din WordPress blogg.

Gå bara till Settings ” WP Media Folder för att komma igång.

Connecting a website to Google Drive

I menyn till vänster väljer du ”Cloud” och ”Google Drive”.

Här klickar du helt enkelt på ”Automatisk”.

Connecting Google Drive to WordPress using an automatic connector

Du kan nu gå vidare och klicka på knappen ”Anslut Google Drive”.

Hur man organiserar dina Google Drive Images

Nu när du är ansluten till Google Drive kan du komma åt och organisera dina filer direkt i WordPress dashboard.

Gå bara till Media ” Bibliotek och välj det nya alternativet Google Drive i menyn till vänster.

Accessing Google Drive images in the WordPress dashboard

Du kan nu browsa genom alla images i din Google Drive.

Dessutom kan du filtrera och sortera dessa images eller visa fler filtyper med hjälp av raden av knappar i toolbaren.

Filtering, organizing and sorting images in the WordPress media library

Du kan också skapa new folders för att hantera dina images. Alla ändringar som du gör i WordPress dashboard kommer automatiskt att synkroniseras till det anslutna Google Drive-kontot.

På så sätt kan användare organisera och hantera images även om de inte har direkt tillgång till det anslutna Google-kontot.

Du kan börja med att skapa en ny folder genom att clicka på knappen ”Add New Folder”.

Creating Google Doc folders in the WordPress admin area

I popupen som visas skriver du in ett namn för foldern.

Sedan klickar du bara på ”Skapa”.

Creating an image folder in the WordPress dashboard

Detta skapar en new folder under Google Drive parent folder.

För att lägga till images i foldern klickar du på knappen ”Add New” och väljer sedan en fil från din lokala dator. Denna image kommer att addas till både mediabiblioteket i WordPress och ditt Google Drive account.

Adding images to a new folder in the WordPress dashboard

Om du har run din WordPress website ett tag kanske du redan har massor av images i mediabiblioteket. I så fall kan du enkelt säkerhetskopiera ditt WordPress content till Google Drive genom att uploada dessa filer till ditt Google account.

För att göra detta väljer du helt enkelt ”Mediabibliotek”.

Moving files between WordPress and Google Drive

Sedan hittar du den image som du vill uploada till Google Drive.

Du kan antingen drag and dropa imagen till den överordnade mappen i Google Drive eller till en undermapp som you har skapat.

Organizing your Google Docs using a WordPress plugin

Upprepa helt enkelt dessa steg för att organisera WordPress-filerna i ditt mediabibliotek.

Add Google Drive Images till din WordPress-webbplats

Du kan nu enkelt add to alla Google Drive images till dina WordPress pages och posts. För att göra detta lägger du bara till ett Imagely-block i WordPress content editor och klickar sedan på knappen ”Mediabibliotek”.

How to easily add Google Drive images to your WordPress pages and posts

I mediabiblioteket i WordPress kan du antingen selecta ”Google Drive” eller välja valfri folder i Google Drive.

Du kommer nu att se alla media files som du kan add to.

Adding photos and image files to WordPress using a Google Drive plugin

Klicka bara på den fil du vill använda.

När du har gjort det kan du skriva in alt-text i bilden, lägga till captions och mycket mer på exakt samma sätt som du lägger till en image i WordPress.

Adding alt text, a description, caption, and more to images in WordPress

När du är klar klickar du bara på knappen ”Select”. WP Media Folder kommer nu att add a image till din WordPress page eller post.

Anslut Google Drive manuellt till ditt mediabibliotek i WordPress

Om du inte vill använda WP Media Folders automatiska anslutning kan du ansluta till Google Drive manuellt i Google Cloud Console.

Skapa ett Google Cloud-projekt

För att komma igång, heada över till Google Cloud Console. Om det är första gången du besöker konsolen måste du godkänna Terms and Conditions och välja om du vill få updates via email.

När du har gjort det klickar du på ”Agree and Continue”.

Agreeing to the Google terms and conditions

Detta tar dig till Google Cloud Console.

Du måste skapa ett new projekt, så klicka på ”Select a project”.

Creating a new project in the Google dashboard

I popupen som visas väljer du ”New Project”.

You kan nu skriva in ett namn för projektet. Detta är bara för din referens, så du kan använda vad du vill.

På den här vyn kan du också add to en valfri organisation och ändra den location där Google Cloud Console kommer att skapa ditt projekt.

Entering the information for a new Google Drive project

När du är nöjd med den information som du har enter, gå vidare och klicka på ”Create”.

Aktivera API:et för Google Drive

Därefter väljer du ”Enabled APIs & Services” i menyn till vänster och klickar sedan på ”Enable APIs and Services”.

Enabling Google APIs

På den här vyn visas alla de olika API:er som du kan aktivera. Du kan till exempel visa de senaste videoklippen från din YouTube-kanal genom att aktivera YouTube Data API eller lägga till en Google-kalender i WordPress med hjälp av Calendar API.

För att ansluta Google Drive till WordPress rullar du till sektionen ”Google Workspace” och klickar på ”Google Drive API”.

Enabling the Google Drive API

Du kommer till en vy där du kan aktivera den nyckel som WordPress ska använda för att komma åt din Google Drive.

Det är bara att gå vidare och klicka på knappen ”Aktivera”.

How to enable the Google Drive API

Skapa ett OAuth 2.0-klient-ID

När detta är gjort öppnar du menyn genom att clicka på line icon högst upp i vänstra hörnet.

Välj sedan ”APIs & Services”, följt av ”Credentials”.

Creating credentials for a Google Cloud Console project

Här måste du klicka på ”Create Credentials”.

I dropdown-menyn måste du select ”OAuth client ID”.

Creating an oAuth client for your WordPress website

På nästa vy klickar du på knappen ”Konfigurera skärmen för samtycke”.

Du kan nu välja om du vill skapa en intern eller extern app. Om du väljer ”Internal” kommer endast G Suite-användare inom din organisation att kunna komma åt appen. Om du väljer ”External” kommer din app att vara tillgänglig för alla som har ett Google account.

När du har fattat ditt beslut kan du klicka på ”Create”.

Creating an internal or external Google app

Nu måste du skriva in lite information om Google appen och lägga till ditt företags email address.

Du måste också skriva in det domain name där du planerar att använda applikationen.

Registering an app in the Google Cloud Console

När du har completed detta formulär, click the ”Save and Continue” button.

Du kan nu ange vilket content appen ska ha åtkomst till och vilka actions den kan utföra genom att lägga till scopes. Om du vill se alla olika scope för Google Drive klickar du bara på knappen ”Add or remove scopes”.

Adding scopes to your Google project

För att add to ett scope till your projekt, behöver du bara kontrollera dess box.

Tänk bara på att Google kommer att reviewer alla scopes som är markerade som känsliga.

Adding scopes and APIs to a Google Cloud Console project

När du har lagt till alla scopes du vill använda måste du klicka på ”Update”.

För att gå vidare till nästa vy, click ”Save and continue”.

Adding permissions to a Google project

I det här läget kanske du vill enter lite More information om din app, bland annat hur du planerar att använda den.

Detta steg är valfritt, men det kan hjälpa Google att kontrollera och approve ditt projekt snabbare.

Verifying your app in the Google Console

När du är redo att gå vidare klickar du bara på knappen ”Save and continue”. Google kommer nu att visa en summary av all den information you har enter.

Öppna sedan menyn genom att clicka på linje-iconen och välj sedan ”oAuth Consent Screen”.

Connecting Google Drive to a WordPress project

You will see that your app is currently in test mode.

För att göra den Live, gå vidare och klicka på ”Publicera app”.

Publishing a Google application

Google Cloud Console kommer nu att visa lite information om extra steg som du måste vidta för att klara verifieringsprocessen. Dessa inkluderar att lägga till en länk till din Integritetspolicy och att lägga till din WordPress site till Google Search Console.

När du har läst denna information klickar du bara på knappen ”Bekräfta”.

Pushing a Google app to production

Add Client ID:n och Client Secret till WordPress

När detta är gjort är du redo att skapa klientens ID:n och secret key.

I menyn till vänster väljer du ”Credentials”.

Creating credentials in the Google Cloud platform

Klicka sedan på ”Create Credentials”.

I den dropdown som visas måste du select ”OAuth client ID”.

Creating a client ID and client secret for your WordPress blog or website

På nästa vy öppnar du dropdown-menyn och väljer ”Web application”.

You kan nu skriva in ett namn för din OAuth 2.0-klient. Detta är bara för din referens, så du kan använda vad du vill.

Creating a Google web application

Därefter rullar du till ”Authorized JavaScript origins” section.

I fältet skriver du in din websites domain name.

Adding a WordPress website as an authorized JavaScript origin

Under ”Authorised redirect URIs” add to följande URL, se till att ersätta ”https://your-domain.com” med your own domain name:

https://your-domain.com/wp-admin/options-general.php?page=option-folder&task=wpmf&function=wpmf_authenticated

Adding your site as an authorized direct URL

När du har gjort det rullar du längst ner på vyn och klickar på ”Skapa”.

Efter några ögonblick visar Google ditt kund-ID:n och din client secret i en popup. Du kommer att behöva den här informationen, så obs/observera den på ett säkert ställe.

Getting a client secret and client ID from the Google Cloud Console

You can also download the information as a JSON file.

För att add to klient ID:n och klient secret till WordPress, gå till Settings ” WP Media Folder i WordPress dashpanelen.

Adding a Google client ID and client secret to the WordPress dashboard

I menyn till vänster väljer du ”Cloud” följt av ”Google Drive”.

Sedan måste du selecta ”Manual”.

Manually connecting a WordPress blog or website to your Google Drive account

När du har gjort det klistrar du bara in klient-ID:t och klientens secret i fälten ”Google Client ID” och ”Google Client Secret”.

Klicka nu på ”Anslut till Google Drive”.

Connecting to your Google Drive account using WP Media Folder

I popupen som visas väljer du det Google Drive-konto som du vill använda.

You will now see some information about all the data the app will be able to access and the tasks it can perform. Kontrollera bara boxen bredvid varje behörighet som appen requestar.

Granting an app access to your Google Docs

Klicka sedan på ”Fortsätt”.

Slutligen klickar du på knappen ”Save Changes”.

Adding a client secret to your website or blog

Du har nu utan problem anslutit Google Drive till ditt WordPress mediabibliotek.

Bonus: Importera Google Docs till WordPress

Förutom att ansluta Google Drive till din website kan du också importera Google Docs till WordPress.

Om du till exempel godkänner gästposter på din website och en användare submitterar en post på Google Docs, kan du inte direkt copy and paste innehållet i block editor.

Om du gör det kommer du att få massor av oönskade HTML-taggar, och ibland kan du till och med förlora all originalformatering.

I så fall är det mycket enklare att importera Google Docs-filen än att copy and paste in innehållet i WordPress. För att göra detta kan du använda Grammarly, som är ett populärt grammatikverktyg.

Skapa bara ett konto på plattformen och klistra sedan in Google Docs content i dess editor.

Pasting a Google Doc into the Grammarly writing assistant

När du har gjort det kommer alla HTML-taggar automatiskt att tas bort från innehållet. Du kan nu copy and paste blogginlägget i WordPress block editor där det kommer att visas i korrekt format utan HTML-taggar.

Detaljerade instruktioner finns i vår tutorial om hur du enkelt importerar Google Docs till WordPress.

Vi hoppas att den här artikeln hjälpte dig att lära dig hur du ansluter Google Drive till ditt mediabibliotek i WordPress. Du kanske också vill se vår guide om hur du skapar automatiserade arbetsflöden i WordPress eller se vårt expertval av de bästa analyslösningarna för WordPress-användare.

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

34 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. Jiří Vaněk says

    Is it possible to connect the plugin to only a specific folder on Google Drive, or does it see all the content? I want to know if it is possible to create a single folder on Google Drive for media files for the website, but at the same time, I don’t want the plugin to access other folders on Google Drive that are not related to the website. Is it possible to set it to access only a specific folder, or is this solution not applicable?

    • WPBeginner Support says

      It would depend on the method you are using but the plugin does have the option to have a specific folder for the content.

      Administratör

      • Jiří Vaněk says

        That’s great news because I want to connect to Google Drive for my personal photos, but at the same time, I don’t want the plugin to see other content. You’ve made me very happy. Thanks!

  3. Mrteesurez says

    Whaooo, this is fantastic.
    Wordpress is promising with these types of exciting integration.
    If this is the case, that means it’s possible I host files like ebooks and audios on Google drive and serve it for downloads through WordPress ?

  4. Yinka says

    hi,

    please is there a way to Link media from hard drive on computer with wp site, instead of uploading it to media library… thanks

    • WPBeginner Support says

      We do not have a recommended method for that at the moment as that would require your computer to send the images to anyone trying to view them on your site and if your computer is ever turned off they would no longer be able to see images on your site until it is turned back on.

      Administratör

  5. sashi hari sulochan says

    i am using this plugin to embed videos in my wordpress website, how to hide the poput option of google drive

    • WPBeginner Support says

      For customizing the plugin, you would want to reach out to the plugin’s support and they should be able to assist you :)

      Administratör

  6. Ted Keith says

    I get all the way through this and have the import from google button. Click on the button and sign in with google. Nothing happens, Just goes right back to the import from google button screen. Sigh… wish stuff just worked sometimes. That’s an hour wasted.

  7. Gabriel says

    Same as below. I can import photos from Google Drive but it doesn’t upload properly, it shows a grey box. Images are not imported. What should I change? Thanks for your support

  8. derred beh says

    after following the steps, I can import photos from Google Drive,
    but the file size is just 962B, and when try to view them, I just see a black page, with the square box in it.
    Looks like the images are not properly imported?
    How to fix this?

  9. Giwa says

    my clients newly design WordPress e-commerce site and he is selling eBook. can he use google drive as storage where the buyer can download the eBook after payment?

  10. thisisyeeseul says

    I am using it but it’s still using WordPress storage.
    i wonder, is it possible to use it without storing wordpress?

    plz let me know! thanks!

  11. Stephanie says

    I just tried to install the plugin and it crashed my entire site. Anything I click on gives me this error.

    Parse error: syntax error, unexpected in /home/content/02/14034602/html/wp-content/plugins/external-media/plugins/Box.php on line 75

    This error is the only thing showing on my site to the public right now.

    HELP!

  12. Kerry says

    Hi TARIQ, CAn you help me?
    On the AOath consent screen..there is a place to click on your Gmail account …my husband’s keeps coming up and it’s not giving me any way to put in my address. This occurs right before ”product name shown to users”. How will it know to access my Gmail account/photos.?

  13. Courtney says

    This is not working. I uploaded the plugin and had to do a very complicated Developer setup on Google and WordPress setup. But it is does not do what I need. I need to be able to upload the photos out of my Google Photos into my WordPress.org site, period. This does not display all my updated photos and instead has my documents from years back. The few photos it does show import in as a Google code instead of a picture.

    Please develop a simple Google Photos upload plug-in instead of this.

  14. Arsyila Maulidia says

    Yes, nice info, i just apply on my web and succsesfully connect to google drive,

    I’m arsyila
    Great from Indonesia

    Succses for wpbeginner

  15. Tariq says

    Question,
    Is this method will fit Google SEO requirements? I dont think so and this will reduce our score. (If it will work)

    The correct way using google drive with ANY website is to have G-Suit account and point an Google website (Only available in G-Suite since last Aug, 31 2017) as a sub domain in your website. This way you will increase your score by hosting static content in CDN.

    Good luck.

    • J. Nijhuis says

      This is not a CDN, it;s just an addon for directly browsing Google Drive images from within WP. The files are imported into your WP media library just like any other image you upload.

  16. Mayank says

    Found an error, unable to work.

    Uncaught TypeError: Cannot read property ’add’ of undefined
    at Object. (external-media-view.js:23)

  17. Abdulaziz Alnasi says

    as you know that google offers Google photos service for free with unlimited storage, so what I think about is to store my images into google photos instead of having them on my host.
    since I have shared hosting this method will decrease the load on my server.

    so the question is: is (Google Drive) way will allow me to store my images into Google photos instead of google drive?

    • Tariq says

      No, Google give permission to host your image and call it from Google drive folder inside your website but ONLY if you are G-Suit member.

  18. Virgo says

    With the plugin version 1.10.14 the callback url is changed from

    example.com/index.php?external_media_plugin=GooglePickerAPI
    to

    example.com/index.php?external_media_plugin=GoogleDrive

    And in the Google API Console you need to enable the Google Drive APi too!

  19. galodu says

    Great plugin. Thanks a lot for through instructions. Everything is in place. Only issue I am facing is that the images are not properly imported to media library. Images are corrupted. Please let me know how to solve the issue.

  20. Orestis Rovakis says

    That’s very informational and i will use it soon. But what brought me here waas the search for a way to transfer all my media filew to Google Drive so i can save space from my server. Does anyone know anyway to do that?

  21. Dinil Abeygunawardane says

    This is great, but this imports files to WP!
    Is there a way to display images on WP without importing them?

    • Tony says

      I totally agree. This is what brought me here too. A way to display images from a cloud storage service such as Dropbox or Google Drive without storing them into WordPress Media Library!
      This would be totally useful. What about CDN’s, do they do that?

      • vikash says

        hi Tony
        Do Know that how is it possible? please tell me in detail i really need this for my website. thank you

      • Tariq says

        This already Google drive offer it exactly in the way you ask but you need to be Google Suit member for 5$/m and they are giving you a real big benefit for this money, not only G-Drive, but much much more.

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.