Skip to main content

getWordPressProps Reference

getWordPressProps is a function that should be returned within Next.js' getStaticProps or getServerSideProps to properly setup the Faust Template Hierarchy system.


To properly configure getWordPressProps, create pages/[...wordpressNode].js with the following content:

import { getWordPressProps, WordPressTemplate } from '@faustwp/core';

export default function Page(props) {
return <WordPressTemplate {...props} />;

export function getStaticProps(ctx) {
return getWordPressProps({ ctx });

export async function getStaticPaths() {
return {
paths: [],
fallback: 'blocking',

This above example uses getStaticProps, but you can alternatively use getServerSideProps if you'd like.


Below is the getWordPressProps config object defined as a TypeScript type:

type GetWordPressPropsConfig<Props = Record<string, unknown>> = {
* The Next.js getServerSideProps or getStaticProps context. This is required.
ctx: GetServerSidePropsContext | GetStaticPropsContext;
* Any props you would like returned to the Faust templates
props?: Props;
* The Next.js revalidate value. By default, Faust sets a smart default of 900 seconds (15 minutes)
revalidate?: number | boolean;