PHPackages                             innocode-digital/wp-prerender-aws-lambda - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. innocode-digital/wp-prerender-aws-lambda

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

innocode-digital/wp-prerender-aws-lambda
========================================

Generates HTML for client-side rendered content via AWS Lambda.

1.6.0(3y ago)02.5k2GPL-2.0+PHPPHP &gt;=7.1

Since Dec 8Pushed 3y ago11 watchersCompare

[ Source](https://github.com/innocode-digital/wp-prerender-aws-lambda)[ Packagist](https://packagist.org/packages/innocode-digital/wp-prerender-aws-lambda)[ RSS](/packages/innocode-digital-wp-prerender-aws-lambda/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (20)Used By (0)

AWS Lambda Prerender
====================

[](#aws-lambda-prerender)

### Description

[](#description)

Generates HTML for client-side rendered content via AWS Lambda. This plugin sends request to [AWS Lambda Prerender](https://github.com/innocode-digital/aws-lambda-prerender) function which renders content with [Puppeteer](https://github.com/puppeteer/puppeteer) and returns HTML back through REST API callback.

### Install

[](#install)

- Preferable way is to use [Composer](https://getcomposer.org/):

    ```
    composer require innocode-digital/wp-prerender-aws-lambda

    ```

    By default, it will be installed as [Must Use Plugin](https://codex.wordpress.org/Must_Use_Plugins). It's possible to control with `extra.installer-paths` in `composer.json`.
- Alternate way is to clone this repo to `wp-content/mu-plugins/` or `wp-content/plugins/`:

    ```
    cd wp-content/plugins/
    git clone git@github.com:innocode-digital/wp-prerender-aws-lambda.git
    cd wp-prerender-aws-lambda/
    composer install

    ```

If plugin was installed as regular plugin then activate **AWS Lambda Prerender** from Plugins page or [WP-CLI](https://make.wordpress.org/cli/handbook/): `wp plugin activate wp-prerender-aws-lambda`.

### Configuration

[](#configuration)

Add the following constants to `wp-config.php`:

```
define( 'AWS_LAMBDA_PRERENDER_KEY', '' );
define( 'AWS_LAMBDA_PRERENDER_SECRET', '' );
define( 'AWS_LAMBDA_PRERENDER_REGION', '' ); // e.g. eu-west-1

define( 'AWS_LAMBDA_PRERENDER_FUNCTION', '' ); // Optional, default value is "prerender-production-render"

```

Create Lambda function on AWS. Expected default name is **prerender-production-render**but you may use any other. There is a prepared function [AWS Lambda Prerender](https://github.com/innocode-digital/aws-lambda-prerender).

Used user should have `InvokeFunction` in policy.

---

```
define( 'AWS_LAMBDA_PRERENDER_DB_TABLE', '' ); // Optional, default value is "innocode_prerender"

define( 'AWS_LAMBDA_PRERENDER_QUERY_ARG', '' ); // Optional, default value is "innocode_prerender"

```

It's possible to change database table name where HTML will be stored and query argument which is using when serverless function makes request to website.

### Usage

[](#usage)

Plugin automatically generates HTML on Post/Page and Term save action with updating of related content like Frontpage, but it's possible to control this behavior e.g. if you do not want to update author's archive page on post save then use next filter:

```
add_filter( 'innocode_prerender_should_update_post_author', function (
    (bool) $should_update,
    int $object_id,
    $id
) : bool {
    // Do not update achive page of author with user id 5.
    if ( $id == 5 ) {
        return false;
    }

    return $should_update;
}, 10, 3 );

```

Also, plugin generates HTML "on the fly" when someone visits any of object with [template](#existing-templates)e.g. single post and if there is no content in database for current object in current version then cron task will be scheduled to make new request to Lambda.

If theme does not support e.g. date archives then it's possible to disable them at all:

```
add_filter( 'innocode_prerender_template', function ( string $template ) : string {
    if ( $template == 'date_archive' ) {
        return '';
    }

    return $template;
} );

```

Also, it's possible to add custom template in addition to [existing](#existing-templates):

1. Create new template from `Innocode\Prerender\Abstracts\AbstractTemplate` class:

```
...
use Innocode\Prerender\Abstracts\AbstractTemplate;

class YourTemplate extends AbstractTemplate
{
    ...
}

```

2. Implement method stubs in your template class.
3. Add your template class object to templates collection:

```
$your_template = new YourTemplate();
innocode_prerender()->insert_templates( [ $your_template ] );

```

By default, plugin uses selector `#app` to grab content, i.e. that your client-side application is wrapped in block with ID `app`:

```

```

If it's needed to change selector use next hook:

```
add_filter( 'innocode_prerender_selector', function () : string {
    return '#main';
} )

```

### Notes

[](#notes)

#### Existing templates

[](#existing-templates)

- `post` - Post, Page and Custom Post Type
- `term` - Category, Tag and Custom Taxonomy Term
- `author` - Author Archive
- `frontpage` - Front Page
- `post_type_archive` - Post Type Archive
- `date_archive` - Year, Month and Day Archives

#### Version

[](#version)

It was mentioned above that content has a version, and you may want to upgrade it at some point, most obvious case when something has been changed in client-side rendered layout. In this case it's needed to bump new version:

```
if ( function_exists( 'innocode_prerender' ) ) {
    innocode_prerender()
        ->get_db()
        ->get_html_version()
        ->bump();
}

```

But, you can install [Flush Cache Buttons](https://github.com/innocode-digital/wp-flush-cache)plugin which adds possibility to do this action by clicking on the button in admin panel.

#### Modify content during prerendering

[](#modify-content-during-prerendering)

Sometimes content which is prerendered should be different from what we get on client-side e.g. you may need to exclude certain element. In this case use JavaScript global variable:

```
if (window.__INNOCODE_PRERENDER__) {
    // Only for prerendering.
} else {
    // Only for client-side.
}

```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~62 days

Total

13

Last Release

1305d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b52f801a1cdb5f6622a9e49f4359717b1808ca23e948a243eae225f55e2c7eb?d=identicon)[smfb-dinamo](/maintainers/smfb-dinamo)

---

Top Contributors

[![kuliebiakin](https://avatars.githubusercontent.com/u/6066592?v=4)](https://github.com/kuliebiakin "kuliebiakin (85 commits)")[![zhyian](https://avatars.githubusercontent.com/u/8911089?v=4)](https://github.com/zhyian "zhyian (40 commits)")

---

Tags

wordpressprerenderplugins

### Embed Badge

![Health badge](/badges/innocode-digital-wp-prerender-aws-lambda/health.svg)

```
[![Health](https://phpackages.com/badges/innocode-digital-wp-prerender-aws-lambda/health.svg)](https://phpackages.com/packages/innocode-digital-wp-prerender-aws-lambda)
```

###  Alternatives

[tgmpa/tgm-plugin-activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

1.8k222.5k13](/packages/tgmpa-tgm-plugin-activation)[aristath/kirki

Extending the WordPress customizer

1.3k73.0k4](/packages/aristath-kirki)[balbuf/composer-wp

Manage WordPress core, plugins, and themes with composer.

173.6k](/packages/balbuf-composer-wp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
