# WordPress

> Render Mentionwell posts inside WordPress without writing a plugin.

> **The fast path:** open the [Connect wizard](/docs/connect-wizard) and pick **WordPress / Ghost / Sanity / Webflow / custom CMS**, then select **WordPress (REST API)**. The wizard saves `publishEndpoint` as your WordPress `/wp-json/wp/v2/posts` URL and the test step pings it with a stub post. Pair with the plugin or adapter below for the actual create-post mapping.


You don't need a plugin. Two patterns work.

## Pattern A: Server-side proxy + shortcode

In your theme's `functions.php`:

```php
add_shortcode("mentionwell_blog", function () {
  $url = getenv("MENTIONWELL_API_URL") . "/api/public/" . getenv("MENTIONWELL_SITE_SLUG") . "/posts?limit=12";
  $response = wp_remote_get($url, [
    "headers" => [ "Authorization" => "Bearer " . getenv("MENTIONWELL_API_KEY") ]
  ]);
  if (is_wp_error($response)) return "";
  $body = json_decode(wp_remote_retrieve_body($response), true);
  $out = '<ul class="mentionwell-list">';
  foreach ($body["posts"] ?? [] as $p) {
    $out .= sprintf('<li><a href="/blog/%s">%s</a></li>', esc_attr($p["slug"]), esc_html($p["title"]));
  }
  return $out . "</ul>";
});
```

Use it in any post or page: `[mentionwell_blog]`.

## Pattern B: WP REST endpoint

Register a custom endpoint at `/wp-json/mentionwell/v1/posts`. Have it call Mentionwell's API server-side, then fetch from your theme's JS.

## Custom domain for posts

Set up a rewrite from `/blog/(.*)` on your WordPress host to a small PHP page that calls the post detail endpoint and renders `post.html`.

> WordPress's own block editor / Gutenberg can stay untouched — Mentionwell sits next to your existing content, not inside it.


---

Canonical URL: https://mentionwell.com/docs/frameworks/wordpress
Live HTML version: https://mentionwell.com/docs/frameworks/wordpress
Section: Quickstarts by stack
Site index for AI ingestion: https://mentionwell.com/llms.txt
Full reference: https://mentionwell.com/llms-full.txt
