256 Kilobytes

FAQ Schema Generator

Articles in Search Engine Optimization | By Huevos Rancheros

Published 2 months agoFri, 30 Aug 2019 04:32:53 -0700 | Last update 2 months agoFri, 30 Aug 2019 05:04:18 -0700

Generate nice FAQ schema for your pages to boost SERP visibility

275 views, 2 RAMs, and 2 comments

Enter your FAQ Schema content:

Question 1 :
Answer :

Put the code below somewhere on your page. Use this if you're using WordPress.

    

 


What is FAQ Schema and how will it help your SEO? Here's some very relevant content:

 
Users Who Have Downloaded More RAM:
Hash Brown (2 months ago)
yottabyte (1 month ago)
🐏 ⨉ 2
Posted by Huevos Rancheros 2 months ago

Edit History

• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
• [2019-08-30 4:32 PDT] Huevos Rancheros (2 months ago)
🕓 Posted at 30 August, 2019 04:32 AM PDT

Profile Photo - Huevos Rancheros Huevos Rancheros
🗎 24 🗨 105 🐏 61
Staff

I sell rare words


Account created 11 months ago.
24 posts, 105 comments, and 61 RAMs.

Last active 1 week ago:
Commented in thread Post Your Best Pour Up Logo

Profile Photo - August R. Garcia August R. Garcia LARPing as a Sysadmi... Portland, OR
🗎 198 🗨 987 🐏 299
Site Owner

Pour Up:

<script type="application/ld+json">
{
	"@context": "https://schema.org",
	"@type": "FAQPage",
	"mainEntity": [{
		"@type": "Question",
		"name": "What's the deal with airplane peanuts?",
		"acceptedAnswer": {
			"@type": "Answer",
			"text": "The deal with airplane peanuts is that they are generally given out as complimentary refreshments on airlines."
		}
	}]
	}
</script>
Download more RAM. 🐏 ⨉ 0 Posted by August R. Garcia 2 months ago 🕓 Posted at 30 August, 2019 10:52 AM PDT

Sir, I can do you a nice SEO.

Profile Photo - August R. Garcia August R. Garcia LARPing as a Sysadmi... Portland, OR
🗎 198 🗨 987 🐏 299
Site Owner

PHP function to generate FAQ schema:

// @param $arr - An associative array where each key is a question and each value is its answer
function arr_to_faq_schema($arr) {  
        // Prepare the base structure of the associative array, which will be converted to JSON
        $assoc = [
                "@context"   => "https://schema.org",
                "@type"      => "FAQPage"           ,
                "mainEntity" => [
                ],  
        ];  
        
        // Insert the questions into the 
        foreach ($arr as $question => $answer) {
                $assoc["mainEntity"][] = [
                        "@type" => "Question", 
                        "name"  => $question ,        
                        "acceptedAnswer" => [
                                "@type" => "Answer" , 
                                "text"  => $answer 
                        ]
                ];   
        } 

        // Convert the associative array to JSON and place it between the required
        // <script> tags 
        $json = json_encode($assoc); 
        return "<script type='application/ld+json'>$json</script>"; 
} 

// Prepare an associative array where each key is a question and each value is its answer 
$arr = [
        "What time is it?"                   => "It's 5 PM"              ,
        "When is Father's Day?"              => "Sunday, 16 June, 2019"  ,
        "What is an example of an HTML tag?" => "The <strong> tag."          
];  

// Echos the result into the webpage. Will not be visible (unless viewing the page source), since it is wrapped in <script> tags.  
echo arr_to_faq_schema($arr);                  

// Optional/For convenience - Echo the same content out into human-visible/readable HTML   
foreach ($arr as $question => $answer) {
        echo "<h3>" . htmlspecialchars($question) . "</h3>"; 
        echo "<p>"  . htmlspecialchars($answer  ) . "</p>" ;     
} 
Users Who Have Downloaded More RAM:
yottabyte (1 week ago)
🐏 ⨉ 1
Posted by August R. Garcia 3 weeks ago 🕓 Posted at 24 October, 2019 17:46 PM PDT

Sir, I can do you a nice SEO.

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.