{"id":60715,"date":"2021-07-12T17:58:34","date_gmt":"2021-07-12T15:58:34","guid":{"rendered":"https:\/\/jesusyesares.com\/?p=60715"},"modified":"2026-11-27T18:23:07","modified_gmt":"2026-11-27T17:23:07","slug":"how-to-embed-a-google-maps-map-in-wordpress","status":"publish","type":"post","link":"https:\/\/jesusyesares.com\/en\/visualizacion-datos\/how-to-embed-a-google-maps-map-in-wordpress\/","title":{"rendered":"How to embed a Google Maps map in WordPress manually"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The easiest way to <strong>embed a Google Maps map in WordPress<\/strong> is probably the one we&#8217;re about to look at.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s actually very simple, since <strong>Google Maps<\/strong> itself gives us the code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, on the map we&#8217;re using, <strong>in Google Maps, in the left sidebar<\/strong> where the details of the selected search appear, we <strong>click the Share button<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"900\" height=\"509\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" src=\"http:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-1.jpg\" alt=\"Embedding a Google map, Share button\" class=\"wp-image-1513\" srcset=\"https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-1.jpg 900w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-1-300x170.jpg 300w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-1-768x434.jpg 768w\" fetchpriority=\"high\" \/><figcaption class=\"wp-element-caption\">Share button for embedding a Google map in WordPress<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A modal window then appears with the map we want to embed, but on the tab that lets us send the map as a link. So we switch to the <strong>Embed a map<\/strong> tab.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;ll then see some code, a selector that lets us choose between medium, large or small, and a link that says <strong>Copy HTML<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once we&#8217;ve chosen the map size, we click the <strong>Copy HTML<\/strong> link.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"814\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" src=\"http:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-2.jpg\" alt=\"Copying the HTML code for the iframe that embeds the Google map\" class=\"wp-image-1514\" srcset=\"https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-2.jpg 800w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-2-295x300.jpg 295w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-2-768x781.jpg 768w\" fetchpriority=\"low\" \/><figcaption class=\"wp-element-caption\">Copy HTML button for the iframe that embeds the Google map<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The full copied code will look like this.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n&lt;iframe src=&quot;https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3179.016523905674!2d-3.5903353482002385!3d37.176078279774075!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd71fcb7977fb93b%3A0x808dd1ef1221a27f!2sAlhambra!5e0!3m2!1ses!2ses!4v1626065631650!5m2!1ses!2ses&quot; width=&quot;600&quot; height=&quot;450&quot; style=&quot;border:0;&quot; allowfullscreen=&quot;&quot; loading=&quot;lazy&quot;&gt;&lt;\/iframe&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Note that it&#8217;s an <strong>HTML iframe tag<\/strong>, whose source (the src attribute) is the URL of the Google Maps view we currently have on screen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In fact, if we simplify it so you can see the code more clearly, we&#8217;d have this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n&lt;iframe src=&quot;#&quot; width=&quot;600&quot; height=&quot;450&quot; style=&quot;border:0;&quot; allowfullscreen=&quot;&quot; loading=&quot;lazy&quot;&gt;&lt;\/iframe&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">If you look closely, <strong>the first parameter (src) is the URL,<\/strong> the <strong>second is the window width (width)<\/strong>, the <strong>third (height) is the window height<\/strong>, then there&#8217;s <strong>another that lets us define the window style (style)<\/strong>, in this case with no border, and two more that let us show the map full screen (allowfullscreen) and load the map only when it actually becomes visible on screen rather than from the start (loading=&#8221;lazy&#8221;).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now that we know how the code works, <strong>we insert it into our post with the Custom HTML block<\/strong>. We simply add the block and paste the code.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"244\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" src=\"http:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-3.jpg\" alt=\"HTML code with the iframe inserted in the WordPress editor\" class=\"wp-image-1515\" srcset=\"https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-3.jpg 900w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-3-300x81.jpg 300w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-3-768x208.jpg 768w\" fetchpriority=\"low\" \/><figcaption class=\"wp-element-caption\">HTML code with the iframe inserted in the WordPress editor<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once that&#8217;s done, we could change a parameter such as the width, for example setting it to 100% of the screen width.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you click Preview, you&#8217;ll see the map on the block. And once published, the final result will be as shown below. You can see it on <a href=\"https:\/\/wpgis.com\/2021\/07\/12\/insertar-un-mapa-en-wordpress-manualmente\/\" target=\"_blank\" rel=\"noopener\">wpgis.com<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"678\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" src=\"http:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-4.jpg\" alt=\"Google map previewed in the WordPress editor\" class=\"wp-image-1516\" srcset=\"https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-4.jpg 900w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-4-300x226.jpg 300w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-4-768x579.jpg 768w\" fetchpriority=\"low\" \/><figcaption class=\"wp-element-caption\">Google map previewed in the WordPress editor<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"787\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" src=\"http:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-5.jpg\" alt=\"Finished post with the Google map embedded\" class=\"wp-image-1517\" srcset=\"https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-5.jpg 900w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-5-300x262.jpg 300w, https:\/\/jesusyesares.com\/wp-content\/uploads\/2019\/08\/insertar-google-maps-en-wordpress-manualmente-5-768x672.jpg 768w\" fetchpriority=\"low\" \/><figcaption class=\"wp-element-caption\">Final result with the Google map embedded<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">So, as you can see, there&#8217;s not much to it: you just copy the code Google Maps gives you and paste it into the Custom HTML block.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, you&#8217;ll find there&#8217;s a small catch: to show a Google Maps map on your website, you&#8217;ll have to <a href=\"https:\/\/wpcarto.com\/webmapping\/como-dar-de-alta-la-api-de-google-maps\/\" data-type=\"post\" data-id=\"1529\">sign up for the Google Maps API for your website<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That said, there&#8217;s a trick to avoid having to sign up for this API. It involves <strong>adding the following query to the end of the src URL<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n?output=embed\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">That way, it ends up like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n&lt;iframe src=&quot;https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3179.025006883144!2d-3.589958633773272!3d37.175876679872985!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd71fcb7977fb93b%3A0x808dd1ef1221a27f!2sAlhambra!5e0!3m2!1ses!2ses!4v1626608197369!5m2!1ses!2ses?output=embed&quot; width=&quot;600&quot; height=&quot;450&quot; style=&quot;border:0;&quot; allowfullscreen=&quot;&quot; loading=&quot;lazy&quot;&gt;&lt;\/iframe&gt;\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; light: false; title: ; toolbar: true; notranslate\" title=\"\">\n&lt;iframe src=&quot;https:\/\/www.google.com\/maps\/embed?pb=!1m18!1m12!1m3!1d3179.025006883144!2d-3.589958633773272!3d37.175876679872985!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0xd71fcb7977fb93b%3A0x808dd1ef1221a27f!2sAlhambra!5e0!3m2!1ses!2ses!4v1626608197369!5m2!1ses!2ses?output=embed&quot; style=&quot;border:0;&quot; allowfullscreen=&quot;&quot; loading=&quot;lazy&quot; width=&quot;600&quot; height=&quot;450&quot;&gt;&lt;\/iframe&gt;\n<\/pre><\/div><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:94,&quot;href&quot;:&quot;https:\\\/\\\/wpgis.com\\\/2021\\\/07\\\/12\\\/insertar-un-mapa-en-wordpress-manualmente&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:95,&quot;href&quot;:&quot;https:\\\/\\\/wpcarto.com\\\/webmapping\\\/como-dar-de-alta-la-api-de-google-maps&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]\"><\/span>","protected":false},"excerpt":{"rendered":"<p>The easiest way to embed a Google Maps map in WordPress is probably with an HTML iframe, as we&#8217;ll see here.<\/p>\n","protected":false},"author":2,"featured_media":60721,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_ayudawp_aiss_exclude":false,"_ayudawp_aiss_exclude_summary":false,"_ayudawp_aiss_summary":"The easiest way to embed a Google Maps map in WordPress is probably the one we're about to look at. If you look closely, the first parameter (src) is the URL, the second is the window width (width), the third (height) is the window height, then there's another that lets us define the window style (style), in this case with no border, and two more that let us show the map full screen (allowfullscreen) and load the map only when it actually becomes visible on screen rather than from the start (loading=\"lazy\"). However, you'll find there's a small catch: to show a Google Maps map on your website, you'll have to sign up for the Google Maps API for your website.","_ayudawp_aiss_summary_provider":"extractive","_ayudawp_aiss_summary_hash":"376469ee6e3e840d479ec74b906385723a798116","footnotes":""},"categories":[338],"tags":[],"class_list":["post-60715","post","type-post","status-publish","format-standard","has-post-thumbnail","category-visualizacion-datos"],"openstation_lock":null,"openstation_contributors":[],"openstation_attached_media":[60721,1513,1514,1515,1516,1517,1529],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/posts\/60715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/comments?post=60715"}],"version-history":[{"count":1,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/posts\/60715\/revisions"}],"predecessor-version":[{"id":60731,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/posts\/60715\/revisions\/60731"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/media\/60721"}],"wp:attachment":[{"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/media?parent=60715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/categories?post=60715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jesusyesares.com\/en\/wp-json\/wp\/v2\/tags?post=60715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}