Integrations/WordPress
WordPress

Website screenshots in WordPress

Generate and display website thumbnails on your WordPress site

Integrate the Allscreenshots API with your WordPress site to automatically generate and display website screenshots. Perfect for link directories, resource pages, portfolio galleries, and affiliate sites that need visual previews of external URLs.

How it works

Get started in 4 steps

1

Get your API key

Sign up for Allscreenshots and grab your API key from the dashboard.

2

Add a custom function

Add a PHP function to your theme or a custom plugin to call the Allscreenshots API.

3

Display screenshots

Use a shortcode or block to display website screenshots in posts and pages.

4

Cache results

Use WordPress transients to cache screenshot URLs and avoid redundant API calls.

</>Code Example

WordPress Shortcode

php
1<?php
2// Add to functions.php or a custom plugin
3function allscreenshots_shortcode($atts) {
4    $atts = shortcode_atts([
5        'url' => '',
6        'width' => 1280,
7        'height' => 800,
8        'fullpage' => 'false',
9    ], $atts);
10
11    if (empty($atts['url'])) return '';
12
13    $cache_key = 'screenshot_' . md5($atts['url']);
14    $screenshot_url = get_transient($cache_key);
15
16    if (!$screenshot_url) {
17        $response = wp_remote_post(
18            'https://api.allscreenshots.com/v1/screenshot',
19            [
20                'headers' => [
21                    'Authorization' => 'Bearer ' . SCREENSHOT_API_KEY,
22                    'Content-Type'  => 'application/json',
23                ],
24                'body' => wp_json_encode([
25                    'url'      => $atts['url'],
26                    'fullPage' => $atts['fullpage'] === 'true',
27                    'viewport' => [
28                        'width'  => (int) $atts['width'],
29                        'height' => (int) $atts['height'],
30                    ],
31                ]),
32            ]
33        );
34
35        $body = json_decode(wp_remote_retrieve_body($response));
36        $screenshot_url = $body->screenshotUrl;
37        set_transient($cache_key, $screenshot_url, DAY_IN_SECONDS);
38    }
39
40    return sprintf(
41        '<img src="%s" alt="Screenshot of %s" loading="lazy" />',
42        esc_url($screenshot_url),
43        esc_attr($atts['url'])
44    );
45}
46add_shortcode('screenshot', 'allscreenshots_shortcode');
47// Usage: [screenshot url="https://example.com"]
Benefits

Why use Allscreenshots with WordPress

Simple shortcode

Display screenshots anywhere with [screenshot url="..."]. No coding beyond the initial setup.

Built-in caching

WordPress transients cache screenshot URLs to minimize API calls and speed up page loads.

No plugin dependency

A lightweight function — no bloated plugin needed. Add it to your theme or a mu-plugin.

Frequently asked questions

There is no dedicated plugin yet, but the shortcode example above can be added to your theme's functions.php in minutes. It's lightweight and has no external dependencies.

Read the full tutorial

Step-by-step guide to integrating Allscreenshots with WordPress, including advanced options and best practices.

Read the blog post

Pricing that scales with you

No hidden fees. No surprises. Just screenshots.

100 free screenshots on sign-up · 50 bonus for each friend you invite

Starter

$18/mo
  • 1,500 screenshots/mo
  • 50/min rate limit
  • $0.009 overage
  • All features included
Get Started
Most Popular

Pro

$45/mo
  • 7,500 screenshots/mo
  • 100/min rate limit
  • $0.009 overage
  • All features included
Get Started

Business

$149/mo
  • 30,000 screenshots/mo
  • 200/min rate limit
  • $0.0075 overage
  • All features included
Get Started

Enterprise

$329/mo
  • 100,000 screenshots/mo
  • 400/min rate limit
  • $0.005 overage
  • All features included
Get Started

Ready to integrate with WordPress?

Start with 100 free screenshots every month. No credit card required.