Skip to content

Commit bc590a0

Browse files
authored
Merge pull request #251 from wpengine/docs-update-sitemaps-docs-for-other-wp-plugins
docs: Update sitemaps docs for other wp plugins
2 parents 39890a2 + 53278da commit bc590a0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/pages/docs/how-to/sitemaps/index.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,23 @@ export function getServerSideProps(ctx) {
7070
```
7171

7272
Run the dev server again and visit the sitemap URL. You now have WordPress content and Next.js content in your Faust app.
73+
74+
## 4. Changing the sitemap URL for other WP SEO plugins
75+
76+
If you prefer to use a different sitemap instead of the default one provided by WordPress, Faust allows integration with other WordPress SEO plugins like [Rank Math](https://rankmath.com/) or [Yoast SEO](https://yoast.com/wordpress/plugins/seo/).
77+
78+
Simply update the `sitemapIndexPath` argument to point to the plugin's sitemap URL.
79+
80+
Here is an example for the Rank Math plugin:
81+
82+
```js {6} title="pages/sitemap.xml.js"
83+
import { getSitemapProps } from "@faustwp/core";
84+
export default function Sitemap() {}
85+
86+
export function getServerSideProps(ctx) {
87+
return getSitemapProps(ctx, {
88+
sitemapIndexPath: "sitemap_index.xml",
89+
frontendUrl: process.env.FRONTEND_URL,
90+
});
91+
}
92+
```

0 commit comments

Comments
 (0)