{"id":234176,"date":"2023-02-05T12:56:00","date_gmt":"2023-02-05T09:56:00","guid":{"rendered":"https:\/\/wordpress.mediadoma.com\/?p=234176"},"modified":"2023-02-05T12:57:00","modified_gmt":"2023-02-05T09:57:00","slug":"comment-ajouter-un-moteur-de-recherche-google-au-blog-wordpress-widget-code-html-simple","status":"publish","type":"post","link":"https:\/\/wordpress.mediadoma.com\/fr\/comment-ajouter-un-moteur-de-recherche-google-au-blog-wordpress-widget-code-html-simple\/","title":{"rendered":"Comment ajouter un moteur de recherche Google au blog WordPress &#8211; Widget &#8211; Code HTML simple ?"},"content":{"rendered":"<p>Dans <a href=\"https:\/\/wordpress.mediadoma.com\/fr\/remplacer-le-champ-de-recherche-integre-de-wordpress-par-google-customize-search\/\" title=\"cet article\">cet article<\/a> et <a href=\"https:\/\/wordpress.mediadoma.com\/fr\/comment-personnaliser-le-moteur-de-recherche-pour-wordpress\/\" title=\"cet article\">cet article<\/a>, nous savons comment remplacer le moteur de recherche wordpress int\u00e9gr\u00e9 en utilisant Google. Cela n\u00e9cessite une modification des mod\u00e8les PHP, ce qui peut ne pas \u00eatre possible dans certains cas. Vous pouvez le faire en utilisant la m\u00e9thode simple suivante.<\/p>\n<p>Il vous suffit d&rsquo;ajouter un widget Texte apr\u00e8s [Apparence] &#8211; [Widgets]. Ajoutez ensuite le <a href=\"https:\/\/helloacm.com\/html-hyper-link-in-new-windows-by-xhtml-1-0-standard\/\" target=\"_blank\" rel=\"noopener nofollow\" class=\"external external_icon\">code HTML suivant.<\/a><\/p>\n<pre><code>&lt;form onsubmit='javascript: document.getElementById(\"q\").value+=\" site:\"+window.location.hostname;' action='<\/code><\/pre>\n<p>L&rsquo;id\u00e9e est simple et le code est simple. Il utilise un formulaire HTML qui sera soumis \u00e0 la m\u00e9thode Google Search by GET avec la cha\u00eene de requ\u00eate q=query. Et un &lsquo;site:&rsquo; + <strong>window.location.hostname<\/strong> sera ajout\u00e9 \u00e0 la requ\u00eate afin que la recherche soit limit\u00e9e \u00e0 votre domaine uniquement (syntaxe de requ\u00eate de recherche Google).<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-154858-61e54d080f1b4.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-154858-61e54d080f1b4.jpg\" alt=\"Comment ajouter un moteur de recherche Google au blog Wordpress - Widget - Code HTML simple ?\"><\/a><\/p>\n<p>widget-moteur-de-recherche<\/p>\n<p>Et vous \u00eates autoris\u00e9 \u00e0 avoir deux moteurs de recherche \u2013 Google et la recherche WordPress int\u00e9gr\u00e9e.<\/p>\n<p><a href=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-154858-61e54d0917280.jpg\" data-rel=\"lightbox\"><img decoding=\"async\" class=\"SDStudio-light-box-enable SDStudio-editor-tools-md-imp\" src=\"https:\/\/wordpress.mediadoma.com\/wp-content\/uploads\/2022\/01\/post-154858-61e54d0917280.jpg\" alt=\"Comment ajouter un moteur de recherche Google au blog Wordpress - Widget - Code HTML simple ?\"><\/a><\/p>\n<p>recherche-via-google-vs-wordpress-recherche<\/p>\n<p><div id=\"PostUnique_PostSource\" style=\"padding-top: 50px\">Source d&rsquo;enregistrement:  <a target=\"_blank\" rel=\"noopener nofollow\" href=\"\/\/helloacm.com\" class=\"external external_icon\">helloacm.com<\/a><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Comment ajouter un moteur de recherche Google au blog WordPress \u2013 Widget \u2013 Code HTML simple ?<\/p>\n","protected":false},"author":1,"featured_media":224515,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[915,893,717,801,841,862],"tags":[1167],"class_list":["post-234176","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-autre","category-code-2","category-developpeur","category-php-3","category-tutoriels","category-wordpress-3","tag-affiai-fr"],"_links":{"self":[{"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/posts\/234176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/comments?post=234176"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/posts\/234176\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/media\/224515"}],"wp:attachment":[{"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/media?parent=234176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/categories?post=234176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress.mediadoma.com\/fr\/wp-json\/wp\/v2\/tags?post=234176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}