How To Embed Google drive (Images, Forms, docs, pdf) in WordPress without Plugin.
How do I embed a Google ? Embedding Google Drive files such as images, PDFs, Docs, Sheets, and Forms in WordPress can improve accessibility and user experience. Instead of relying on plugins, you can embed these files manually using Google Drive’s built-in sharing options and iframe embedding. This method is lightweight and does not impact your website’s performance.
Why Embed Google Drive Files in WordPress?
- Reduces server load by hosting files on Google Drive
- Keeps your WordPress site lightweight and fast
- Allows easy file updates without re-uploading
- Secure file sharing with Google Drive permissions
How to Embed Google Drive Files in WordPress Without a Plugin
1. Embedding Google Drive Images
Steps:
- Upload the image to Google Drive.
- Right-click the image and select Get link.
- Change sharing settings to Anyone with the link.
- Open the image in a new tab and copy the image URL.
- Insert the URL in the WordPress editor using the following HTML:
- For eg this is your url “https://drive.google.com/file/d/1NZ-2hTTjKmCUrIQXT47WIOucd7_-i12y/view?usp=drive_link”
- Now in the custom html add this url with iframe
- <iframe src=”https://drive.google.com/file/d/1NZ-2hTTjKmCUrIQXT47WIOucd7_-i12y/preview?rm=minimal” width=”100%” height=”280″ frameborder=”0″></iframe>
<iframe src=”IMAGE_URL/preview?rm=minimal” width=”100%” height=”280″ frameborder=”0″></iframe>
https://drive.google.com/file/d/1NZ-2hTTjKmCUrIQXT47WIOucd7_-i12y/view?usp=sharing
2. Embedding Google Docs, Sheets, or Slides
Steps:
- Open the Google Doc, Sheet, or Slide.
- Click File > Publish to the Web.
- Copy the provided iframe embed code.
- Paste it into the WordPress Custom HTML block:
- For eg this is your url “https://docs.google.com/document/d/15uYvJYnHoUSSbko8Ud8Zw2Z6xGR2HR-6nUvPf6cWMFc/edit?usp=sharing”
- Now in the custom html add this url with iframe
- <iframe src=”https://docs.google.com/document/d/15uYvJYnHoUSSbko8Ud8Zw2Z6xGR2HR-6nUvPf6cWMFc/preview?rm=minimal” width=”100%” height=”280″ frameborder=”0″></iframe>
<iframe src=”DOCS_URL/preview?rm=minimal” width=”100%” height=”680″ frameborder=”0″></iframe>
3. Embedding Google Forms in WordPress
Steps:
- Open the Google Form you want to embed.
- Click Send, then select the <> Embed option.
- Copy the iframe code and paste it into the WordPress HTML block:
- <iframe src=”https://docs.google.com/forms/d/e/1FAIpQLSeyi_nKlKfXND0uBIhk2kZE3hZblftTHV2_lqVRPLjw0B1hCQ/viewform?embedded=true” width=”640″ height=”955″ frameborder=”0″ marginheight=”0″ marginwidth=”0″>Loading…</iframe>
4. Embedding Google Drive PDFs
Steps:
- Upload the PDF to Google Drive.
- Right-click the PDF and select Get link (set to “Anyone with the link”).
- Open the PDF and copy the file URL.
- Use the following iframe code in WordPress:
- https://drive.google.com/file/d/12ug-oN6K4Df-X5jkP51AgJnzMGSwSQ7O/view?usp=drive_link
- <iframe src=”https://drive.google.com/file/d/12ug-oN6K4Df-X5jkP51AgJnzMGSwSQ7O/preview?rm=minimal” width=”100%” height=”680″ frameborder=”0″></iframe>
https://drive.google.com/file/d/12ug-oN6K4Df-X5jkP51AgJnzMGSwSQ7O/view?usp=drive_link
<iframe src=”PDF_URL/preview?rm=minimal” width=”100%” height=”680″ frameborder=”0″></iframe>
5. Embedding Google Drive Videos
Steps:
- Upload the video to Google Drive.
- Right-click the video and select Get link.
- Change access to “Anyone with the link”.
- Open the video in a new tab and copy the embed URL.
- Paste it into the WordPress HTML block using:
- <iframe src=”VIDEO_URL/preview?rm=minimal” width=”100%” height=”280″ frameborder=”0″></iframe>
SEO Best Practices for Embedding Google Drive Files
- Optimize file names: Rename files with descriptive keywords before uploading.
- Use alt text: Add meaningful alt text to images for better SEO.
- Ensure mobile responsiveness: Adjust iframe widths to
100%
for better display. - Improve loading speed: Host large files on Google Drive to reduce website load time.
- Secure files: Use correct sharing settings to control access.
Conclusion
By following these methods, you can efficiently embed Google Drive images, PDFs, Docs, Forms, and videos in WordPress without using a plugin. This approach helps maintain website performance while ensuring easy file management and accessibility.