Come convalidare lo schema JSON-LD della casella di ricerca dei sitelink di WordPress? Modifica suggerimenti per l'URL della pagina di ricerca
Pubblicato: 2020-04-25 Google per impostazione predefinita supporta Sitelinks search box
. Ma dobbiamo assicurarci che sia impostato correttamente sul sito WordPress.
Che cos'è la casella di ricerca dei sitelink?
Come puoi vedere di seguito, la casella di ricerca di sitelink è una casella di ricerca che aiuta gli utenti a cercare qualsiasi termine in modo molto rapido.
Non devono andare sul tuo sito per cercare. Il risultato viene visualizzato sulla pagina dei risultati di ricerca di Google (SERP) stessa.
Fornisce all'utente suggerimenti di ricerca in tempo reale.
Oggi su Crunchify, mentre esaminavamo altri problemi, abbiamo scoperto che la nostra casella di ricerca dei sitelink era broken
.
Ci è voluto del tempo, ma abbiamo corretto l'URL della casella di ricerca dei sitelink su Crunchify. Vorrei condividere gli stessi suggerimenti con tutti i lettori di Crunchify.
Passo 1. Installa il plugin SEO per WordPress
Assicurati di aver installato il plugin Yoast SEO per WordPress. Per impostazione predefinita, All in One SEO Pack supporta anche JSON-LD e il supporto per la casella di ricerca sitelink.
Stiamo usando lo stesso dagli ultimi anni e finora è buono. Per impostazione predefinita, il plug-in Yoast SEO aggiunge il JSON-LD schema markup
su ciascuna pagina. Basta attivare il plug-in e sei pronto per la tua pagina di ricerca personalizzata.
Cos'è JSON-LD?
JSON-LD sta per
JavaScript Object Notation for Linked Data
, che consiste in array multidimensionali).
Ecco un esempio JSON-lD dalla home page
di Crunchify:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
{ "@context" : "https://schema.org" , "@graph" : [ { "@type" : "WebSite" , "@id" : "https://crunchify.com/#website" , "url" : "https://crunchify.com/" , "name" : "Crunchify" , "inLanguage" : "en-US" , "description" : "Largest free Technical and Blogging resource site for Beginner. We help clients transform their great ideas into reality!" , "potentialAction" : [ { "@type" : "SearchAction" , "target" : "https://crunchify.com/search/?q={search_term_string}" , "query-input" : "required name=search_term_string" } ] } , { "@type" : "CollectionPage" , "@id" : "https://crunchify.com/#webpage" , "url" : "https://crunchify.com/" , "name" : "Crunchify \u2022 Largest free Technical and Blogging resource site for Beginner. We help clients transform their great ideas into reality!" , "isPartOf" : { "@id" : "https://crunchify.com/#website" } , "inLanguage" : "en-US" , "description" : "Largest free Technical, Blogging resource site for Beginners. We help clients transform their great ideas into reality!" } ] } |
Ecco un esempio di JSON-LD su un blog post
di esempio:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
{ "@context" : "https://schema.org" , "@graph" : [ { "@type" : "WebSite" , "@id" : "https://crunchify.com/#website" , "url" : "https://crunchify.com/" , "name" : "Crunchify" , "inLanguage" : "en-US" , "description" : "Largest free Technical and Blogging resource site for Beginner. We help clients transform their great ideas into reality!" , "potentialAction" : [ { "@type" : "SearchAction" , "target" : "https://crunchify.com/search/?q={search_term_string}" , "query-input" : "required name=search_term_string" } ] } , { "@type" : "ImageObject" , "@id" : "https://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/#primaryimage" , "inLanguage" : "en-US" , "url" : "https://cdn.crunchify.com/wp-content/uploads/2020/04/Apache-tomcat-running-on-port-8443-over-HTTPS.png" , "width" : 1261 , "height" : 451 , "caption" : "Apache tomcat running on port 8443 over HTTPS" } , { "@type" : "WebPage" , "@id" : "https://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/#webpage" , "url" : "https://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/" , "name" : "Step by Step guide to Enable HTTPS or SSL correct way on Apache Tomcat Server - Port 8443 \u2022 Crunchify" , "isPartOf" : { "@id" : "https://crunchify.com/#website" } , "inLanguage" : "en-US" , "primaryImageOfPage" : { "@id" : "https://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/#primaryimage" } , "datePublished" : "2020-04-24T06:08:30+00:00" , "dateModified" : "2020-04-24T17:44:01+00:00" , "author" : { "@id" : "https://crunchify.com/#/schema/person/b40f3806c0a1ef3372253a9198e0562f" } , "description" : "It's been almost 12 years I started using Apache Tomcat. I believe when I did my 1st under grade project, it was on Tomcat version 1.x. Now it's already" , "potentialAction" : [ { "@type" : "ReadAction" , "target" : [ "https://crunchify.com/step-by-step-guide-to-enable-https-or-ssl-correct-way-on-apache-tomcat-server-port-8443/" ] } ] } , { "@type" : [ "Person" ] , "@id" : "https://crunchify.com/#/schema/person/b40f3806c0a1ef3372253a9198e0562f" , "name" : "App Shah" , "image" : { "@type" : "ImageObject" , "@id" : "https://crunchify.com/#authorlogo" , "inLanguage" : "en-US" , "url" : "https://secure.gravatar.com/avatar/d8c1b220ca438566d5e5d0e70be7ef5e?s=96&d=mm&r=g" , "caption" : "App Shah" } , "description" : "I'm an Engineer by profession, Blogger by passion & Founder of Crunchify, LLC, the largest free blogging & technical resource site for beginners. Love SEO, SaaS, #webperf, WordPress, Java. With over <a href=\"https://crunchify.com/advertise/\" target=\"_blank\" rel=\"noopener noreferrer\">16 millions+</a> pageviews/month, Crunchify has changed the life of over thousands of individual around the globe teaching Java & Web Tech for FREE. Get latest update on <a target=\"_blank\" href=\"https://www.facebook.com/Crunchify\" class=\"crunchify-social-icon-facebook\" rel=\"noopener noreferrer\"><i class=\"fab fa-facebook\" style=\"margin: 0px 5px\"></i></a> and <a target=\"_blank\" href=\"https://twitter.com/Crunchify\" class=\"crunchify-social-icon-twitter\" rel=\"noopener noreferrer\"><i class=\"fab fa-twitter\" style=\"margin: 0px 0px 0px 5px;\"></i></a>.\r\n\r\n<div style=\"clear:both\"></div>" , "sameAs" : [ "https://facebook.com/Crunchify" , "https://twitter.com/Crunchify" ] } ] } |

Passo 2. Convalida l'URL di ricerca dei sitelink
Assicurati di aver specificato l' correct Sitelinks search URL
. Le righe da 10 a 14 sono evidenziate nel codice sopra. Si prega di ricontrollare.
Per impostazione predefinita Yoast SEO aggiunge sotto l'URL.
-
"target": "https://crunchify.com/?s={search_term_string}"
Note:
se non hai impostato la ricerca personalizzata di Google, sei a posto. Non devi modificare nulla. Ma suggerirei di utilizzare l'impostazione dei risultati di ricerca personalizzata di Google in base agli ultimi 6 anni di esperienza. L'esperienza utente e la qualità dei risultati di ricerca sono molto migliori rispetto alla Ricerca Google predefinita.
Passaggio 3. Modifica l'URL di ricerca di destinazione
Su Crunchify, stiamo utilizzando la configurazione di Google Ricerca Personalizzata. E quindi l'URL di destinazione predefinito non funzionerà per noi.
Il nostro URL di ricerca personalizzato è:
-
https://crunchify.com/search/?q=java
Come modificare l'URL nel markup dello schema di Yoast SEO?
Aggiungi il frammento di codice di seguito al file functions.php del tuo tema e salva le modifiche.
1 2 3 4 5 |
// Yoast - change ld+json search url function crunchify_change_json_ld_search_url ( ) { return trailingslashit ( home_url ( ) ) . 'search/?q={search_term_string}' ; } add_filter ( 'wpseo_json_ld_search_url' , 'crunchify_change_json_ld_search_url' ) ; |
Questo frammento di codice sostituirà e aggiornerà l'URL di ricerca corretto per te:
Ecco un URL aggiornato:
-
"target": "https://crunchify.com/search/?q={search_term_string}"
Passaggio 4. Aspetta qualche settimana
Ora è il momento di aspettare qualche settimana e controllare di nuovo i risultati nella pagina dei risultati di ricerca di Google. Verifica il risultato in tempo reale. Abbiamo apportato modifiche il 24 aprile 2020 e Google ha iniziato a riconoscere la modifica dell'URL subito dopo.
Ecco un URL: https://search.google.com/search-console/sitelinks-searchbox. Seleziona una proprietà e dovresti vedere il risultato.
Ecco un esempio di risultato di ricerca di Crunchify Sitelink.
Ecco maggiori dettagli:
Vuoi saperne di più sui dati strutturati?
Dove inserirlo in una pagina?
JSON-LD?@JohnMu hai parlato di #AskGoogleWebmasters di questa settimana!Dai un'occhiata → https://t.co/b7utqUQf0m pic.twitter.com/iYxgtZGRrr
— Google Webmasters (@googlewmc) 11 settembre 2019
Spero che questo tutorial ti aiuti a risolvere qualsiasi problema che potresti riscontrare per il markup dello schema della casella di ricerca di Google Sitelinks JSON-LD. Buon blog.