{"id":623,"date":"2022-08-31T19:43:22","date_gmt":"2022-09-01T01:43:22","guid":{"rendered":"https:\/\/developers.wpengine.com\/blog\/?p=623"},"modified":"2023-04-19T08:49:11","modified_gmt":"2023-04-19T14:49:11","slug":"sitemaps-in-headless-wordpress-with-faust-js","status":"publish","type":"post","link":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/","title":{"rendered":"Sitemaps in Headless WordPress with Faust.js"},"content":{"rendered":"\n<p>In this article, I will discuss Sitemaps in Headless WordPress using the open-source framework for Headless WordPress &#8211; Faust.js.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">XML Sitemaps<\/h2>\n\n\n\n<p>An XML sitemap is a list of URLs that you want to be publicly available.  It helps search engines crawl your website by giving them an exact map of all your content.  There is also metadata you can pull into your sitemap which is listed in the sitemaps protocol such as when a page was last modified, video information, and images.<\/p>\n\n\n\n<p>Below is an image of a traditional WordPress XML sitemap URL.  The default is your WordPress URL with the added path <code>\/wp-sitemap.xml<\/code> and this is baked into WordPress core from version 5 and above:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\" alt=\"\" class=\"wp-image-624\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">XML Sitemap Benefits<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Faster Indexing<\/strong>: XML sitemaps will communicate with search engines.  You can submit your sitemap into the Google Search Console and that helps get pages on your site indexed much faster with search engines.  This increases your rank in search engine page results.<\/li>\n\n\n\n<li> <strong>Automatic Update Notification<\/strong>: Google will receive automatic notifications when you publish new content or modify existing content.<\/li>\n\n\n\n<li><strong>Categorization of Your Content<\/strong>: Allows Google to know which pages go under which category so there is no guesswork. <\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">XML Sitemaps in the Faust.js framework<\/h2>\n\n\n\n<p>Sitemaps can be complicated to create and process when you are using WordPress in a headless architecture.  Thankfully, the Faust.js team at WP Engine created a feature within the framework that makes it work within a single file within the pages directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setup<\/h2>\n\n\n\n<p>The first step is to install the <a href=\"https:\/\/faustjs.org\/\">Faust.js framework<\/a> with the following command in your terminal:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span>npx create-next-app \\\n<\/span><\/span><span class='shcb-loc'><span>    -e https:<span class=\"hljs-comment\">\/\/github.com\/wpengine\/faustjs\/tree\/main \\<\/span>\n<\/span><\/span><span class='shcb-loc'><span>    --example-path examples\/next\/faustwp-getting-started \\\n<\/span><\/span><span class='shcb-loc'><span>    --<span class=\"hljs-keyword\">use<\/span>-<span class=\"hljs-title\">npm<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Copy the sample environment template:<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-selector-tag\">cp<\/span> <span class=\"hljs-selector-class\">.env<\/span><span class=\"hljs-selector-class\">.local<\/span><span class=\"hljs-selector-class\">.sample<\/span> <span class=\"hljs-selector-class\">.env<\/span><span class=\"hljs-selector-class\">.local<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Connect your WordPress site:<\/strong><\/p>\n\n\n\n<p>Navigate to your <code>.env.local<\/code> file in the root of your project and paste your WP URL as the value:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-comment\"># Your WordPress site URL<\/span>\n<\/span><\/span><span class='shcb-loc'><span>NEXT_PUBLIC_WORDPRESS_URL=https:<span class=\"hljs-comment\">\/\/headlessfw.wpengine.com<\/span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Setting Permalinks and Reading Visibility: <\/strong><\/p>\n\n\n\n<p>Set permalinks In <code>WP Admin &gt;&gt; Settings &gt;&gt; Permalinks<\/code> to: <code>\/posts\/%postname%\/<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.39.41-PM-1024x580.png\" alt=\"\" class=\"wp-image-625\"\/><\/figure>\n\n\n\n<p>Set reading settings in <code>WP Admin &gt;&gt; Settings &gt;&gt; Reading &gt;&gt;<\/code> Search Engine Visibility uncheck box<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.42.54-PM-1024x576.png\" alt=\"\" class=\"wp-image-626\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Faust.js <\/h2>\n\n\n\n<p>Next, navigate back to your Faust.js app, and in the root of the project, go to the <code>\/pages<\/code> directory.  Within the pages directory, create a file and name it <code>sitemap.xml.js.<\/code> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2023\/02\/Screen-Shot-2023-02-15-at-8.53.16-AM-1024x625.png\" alt=\"\" class=\"wp-image-847\"\/><\/figure>\n\n\n\n<p>In the <code>sitemap.xml.js<\/code> you just created, copy and paste this code block:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-keyword\">import<\/span> { getSitemapProps } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@faustwp\/core'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Sitemap<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{}\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getServerSideProps<\/span>(<span class=\"hljs-params\">ctx<\/span>) <\/span>{\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">return<\/span> getSitemapProps(ctx, {\n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"hljs-attr\">frontendUrl<\/span>: process.env.FRONTEND_URL,\n<\/span><\/span><span class='shcb-loc'><span>  });\n<\/span><\/span><span class='shcb-loc'><span>}\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this file, the first thing that is happening is the importing of the sitemap properties on the Faust.js server framework as well as importing the Server Side properties context from Next.js.<\/p>\n\n\n\n<p>Next, we export a default function that is the Sitemap with an empty object.  Once that is done, below is a function in Next.js that allows for server-side rendering.  Within this function, we pass in the server-side props context and then return a config object with the sitemap props.   <\/p>\n\n\n\n<p>The config object requires only one property and that is your <code>frontendUrl<\/code>.<\/p>\n\n\n\n<p>Now that I have this file set up in my pages directory within Faust, I can run <code>npm run dev<\/code> to start the dev server and I am able to access my WordPress content dynamically to my Headless site.  Stoked!! \ud83c\udf89<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-31-at-2.40.53-PM-1024x553.png\" alt=\"\" class=\"wp-image-632\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Defining Next.js Pages for Sitemaps<\/h2>\n\n\n\n<p>The last thing we need to account for in our sitemap is the Next.js pages.  Since we are using Headless WordPress, the front-end URLs need to be on the sitemap as well.  Within the same <code>sitemap.xml.js <\/code>file, simply add a pages property array and place the relative paths of Next.js in the objects within the array like so:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-code-table shcb-line-numbers\"><span class='shcb-loc'><span><span class=\"hljs-keyword\">import<\/span> { getSitemapProps } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@faustwp\/core'<\/span>;\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">Sitemap<\/span>(<span class=\"hljs-params\"><\/span>) <\/span>{}\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><span class='shcb-loc'><span><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">getServerSideProps<\/span>(<span class=\"hljs-params\">ctx<\/span>) <\/span>{\n<\/span><\/span><span class='shcb-loc'><span>  <span class=\"hljs-keyword\">return<\/span> getSitemapProps(ctx, {\n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"hljs-attr\">frontendUrl<\/span>: process.env.FRONTEND_URL,\n<\/span><\/span><span class='shcb-loc'><span>    <span class=\"hljs-attr\">pages<\/span>: &#91;\n<\/span><\/span><span class='shcb-loc'><span>      {\n<\/span><\/span><span class='shcb-loc'><span>        <span class=\"hljs-attr\">path<\/span>: <span class=\"hljs-string\">'\/about'<\/span>,\n<\/span><\/span><span class='shcb-loc'><span>        <span class=\"hljs-attr\">changefreq<\/span>: <span class=\"hljs-string\">'monthly'<\/span>,\n<\/span><\/span><span class='shcb-loc'><span>      },\n<\/span><\/span><span class='shcb-loc'><span>      {\n<\/span><\/span><span class='shcb-loc'><span>        <span class=\"hljs-attr\">path<\/span>: <span class=\"hljs-string\">'\/'<\/span>,\n<\/span><\/span><span class='shcb-loc'><span>      },\n<\/span><\/span><span class='shcb-loc'><span>    ],\n<\/span><\/span><span class='shcb-loc'><span>  });\n<\/span><\/span><span class='shcb-loc'><span>}\n<\/span><\/span><span class='shcb-loc'><span>\n<\/span><\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Running my development server again and visiting the sitemap URL, I now have my WordPress content and my Next.js content in Faust-pages:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-31-at-2.39.26-PM-1024x551.png\" alt=\"\" class=\"wp-image-631\"\/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Super Jamstoked!! \u26a1 of the many benefits of using a framework like Faust.js is the developer toil it removes from your plate, especially in Headless WordPress.  Features like sitemaps should just work simply out of the box with the ability to account for your URLs from WordPress and your front-end without too much heavy lifting. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Additional Features<\/h3>\n\n\n\n<p>Please visit the new Faust.js <a href=\"https:\/\/faustjs.org\/docs\/guides\/sitemaps\">docs<\/a> for features I did not discuss in this article such as ignoring paths in sitemaps and using them with Yoast.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Done! What Next?<\/h2>\n\n\n\n<p>If Faust.js is not your thing, I created another blog post in relation to this using only Next.js and Headless WordPress!!  Check it out <a href=\"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-next-js\">here!<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I will discuss Sitemaps in Headless WordPress using the open-source framework for Headless WordPress &#8211; Faust.js. XML Sitemaps An XML sitemap is a list of URLs that [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-623","post","type-post","status-publish","format-standard","hentry","category-headless"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sitemaps in Headless WordPress with Faust.js - Builders<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sitemaps in Headless WordPress with Faust.js - Builders\" \/>\n<meta property=\"og:description\" content=\"In this article, I will discuss Sitemaps in Headless WordPress using the open-source framework for Headless WordPress &#8211; Faust.js. XML Sitemaps An XML sitemap is a list of URLs that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/\" \/>\n<meta property=\"og:site_name\" content=\"Builders\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-01T01:43:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-19T14:49:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\" \/>\n<meta name=\"author\" content=\"Francis Agulto\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:site\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Francis Agulto\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/\"},\"author\":{\"name\":\"Francis Agulto\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/bcdcb4ac0b215c34b6b30e440a24dc54\"},\"headline\":\"Sitemaps in Headless WordPress with Faust.js\",\"datePublished\":\"2022-09-01T01:43:22+00:00\",\"dateModified\":\"2023-04-19T14:49:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/\"},\"wordCount\":692,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\",\"articleSection\":[\"Headless\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/\",\"name\":\"Sitemaps in Headless WordPress with Faust.js - Builders\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\",\"datePublished\":\"2022-09-01T01:43:22+00:00\",\"dateModified\":\"2023-04-19T14:49:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#primaryimage\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/sitemaps-in-headless-wordpress-with-faust-js\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sitemaps in Headless WordPress with Faust.js\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#website\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"name\":\"Builders\",\"description\":\"Reimagining the way we build with WordPress.\",\"publisher\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"contentUrl\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/wp-content\\\/uploads\\\/2024\\\/05\\\/WP-Engine-Horizontal@2x.png\",\"width\":348,\"height\":68,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/wpebuilders\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCh1WuL54XFb9ZI6m6goFv1g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/#\\\/schema\\\/person\\\/bcdcb4ac0b215c34b6b30e440a24dc54\",\"name\":\"Francis Agulto\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g\",\"caption\":\"Francis Agulto\"},\"description\":\"Fran Agulto is a Developer Advocate at WP Engine. He is a lover of all things headless WordPress, Rock Climbing, and overall being stoked for people that love what they do and share that stoke with others! Follow me on Twitter for cool stoked headless WP!\",\"url\":\"https:\\\/\\\/wpengine.com\\\/builders\\\/author\\\/francis-agultowpengine-com-2-2-2-2-2-2-2-2-2-2-2-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sitemaps in Headless WordPress with Faust.js - Builders","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/","og_locale":"en_US","og_type":"article","og_title":"Sitemaps in Headless WordPress with Faust.js - Builders","og_description":"In this article, I will discuss Sitemaps in Headless WordPress using the open-source framework for Headless WordPress &#8211; Faust.js. XML Sitemaps An XML sitemap is a list of URLs that [&hellip;]","og_url":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/","og_site_name":"Builders","article_published_time":"2022-09-01T01:43:22+00:00","article_modified_time":"2023-04-19T14:49:11+00:00","og_image":[{"url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png","type":"","width":"","height":""}],"author":"Francis Agulto","twitter_card":"summary_large_image","twitter_creator":"@wpebuilders","twitter_site":"@wpebuilders","twitter_misc":{"Written by":"Francis Agulto"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/"},"author":{"name":"Francis Agulto","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/bcdcb4ac0b215c34b6b30e440a24dc54"},"headline":"Sitemaps in Headless WordPress with Faust.js","datePublished":"2022-09-01T01:43:22+00:00","dateModified":"2023-04-19T14:49:11+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/"},"wordCount":692,"commentCount":0,"publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png","articleSection":["Headless"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/","url":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/","name":"Sitemaps in Headless WordPress with Faust.js - Builders","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#primaryimage"},"thumbnailUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png","datePublished":"2022-09-01T01:43:22+00:00","dateModified":"2023-04-19T14:49:11+00:00","breadcrumb":{"@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#primaryimage","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2022\/08\/Screen-Shot-2022-08-30-at-3.00.54-PM-1024x530.png"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/builders\/sitemaps-in-headless-wordpress-with-faust-js\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/builders\/"},{"@type":"ListItem","position":2,"name":"Sitemaps in Headless WordPress with Faust.js"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/builders\/#website","url":"https:\/\/wpengine.com\/builders\/","name":"Builders","description":"Reimagining the way we build with WordPress.","publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/builders\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/builders\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/builders\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","width":348,"height":68,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/wpebuilders","https:\/\/www.youtube.com\/channel\/UCh1WuL54XFb9ZI6m6goFv1g"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/bcdcb4ac0b215c34b6b30e440a24dc54","name":"Francis Agulto","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0c8a05c76944fc987d57296c96dc368055844527088c0aa44297edbfa8b82546?s=96&d=mm&r=g","caption":"Francis Agulto"},"description":"Fran Agulto is a Developer Advocate at WP Engine. He is a lover of all things headless WordPress, Rock Climbing, and overall being stoked for people that love what they do and share that stoke with others! Follow me on Twitter for cool stoked headless WP!","url":"https:\/\/wpengine.com\/builders\/author\/francis-agultowpengine-com-2-2-2-2-2-2-2-2-2-2-2-3\/"}]}},"_links":{"self":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/623\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/categories?post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/tags?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}