WordPress
Use betterfound.ai on a WordPress site that does not run WooCommerce — for example, a content site with a custom product catalogue exposed via the WP REST API or a third-party plugin.
If you run WooCommerce, use the WooCommerce guide instead — it has a dedicated integration with richer product field support.
Option A — Custom JSON endpoint
Register a REST route that returns your products as JSON and use it as a Generic JSON data source in betterfound.ai. Add this to your theme's functions.php or a plugin:
add_action('rest_api_init', function () {
register_rest_route('betterfound/v1', '/products', [
'methods' => 'GET',
'callback' => function () {
$args = ['post_type' => 'product', 'posts_per_page' => -1];
$posts = get_posts($args);
return array_map(function ($p) {
return [
'id' => $p->ID,
'name' => $p->post_title,
'description' => $p->post_content,
'url' => get_permalink($p->ID),
'image_url' => get_the_post_thumbnail_url($p->ID, 'full'),
];
}, $posts);
},
'permission_callback' => '__return_true',
]);
});Your endpoint will be available at:
https://your-site.com/wp-json/betterfound/v1/productsOption B — WP REST API posts endpoint
If your products are standard WordPress posts or a custom post type, the default WP REST API endpoint works directly:
https://your-site.com/wp-json/wp/v2/products?per_page=100Use the Generic JSON data source in betterfound.ai and map the title.rendered, content.rendered, and link fields.
Schema mapping — WordPress REST API field mapping
Install the widget
Use the Insert Headers and Footers plugin or paste directly into your theme:
<!-- In footer.php, before </body> -->
<script src="https://your-dashboard-domain/api/widget/pf.js" async></script>
<product-finder data-api="https://your-dashboard-domain" token="YOUR_WIDGET_TOKEN"></product-finder>Get the exact snippet, pre-filled with your real token, from Widget → Get Code in your betterfound.ai dashboard. You can also use a Shortcode to embed the inline widget on a specific page: register a shortcode that outputs the same tags with
data-mode="inline".