Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Advanced Custom Fields (ACF) can supply the content and image references for social media visuals, but ACF does not itself create finished artwork or automatically set a link preview. You need to retrieve the field values, use them in an image-rendering step if you want a graphic file, and—if you want a preview when someone shares a page—make sure that page outputs the right Open Graph metadata. This guide covers both workflows, from ACF setup to REST API examples and verification.

First decide which kind of social media visual you need

“Social media visual” can mean two different things. Decide which output you are building before choosing how to access ACF data:

  • A graphic file for direct upload: retrieve the text and image values from ACF, then pass them to a rendering or image-generation process that creates a PNG, JPEG, or other suitable asset. ACF provides structured values; it does not automatically compose a finished social graphic.
  • A preview image for a shared page link: publish the intended image URL in the page’s Open Graph metadata. The receiving platform’s scraper reads the page metadata, including og:image, to identify the image representing that page.

The workflows can share the same ACF fields, such as a title, summary, and image, but they have different final steps. A downloadable image is an asset; a link preview is metadata in the page HTML.

Model the ACF fields you want to use

Create a field group and assign it to the relevant post type or content. A practical starting schema might include a short card heading, supporting text, a background or brand image, and an optional per-post share-image override. These are design choices, not required ACF fields. Keep the fields focused on the content needed by the visual or preview.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Choose an Image field return format deliberately

ACF’s Image field can return an image array, an image URL, or an attachment ID. The return format determines what your PHP template receives. With an array, code can use its image details; with a URL, it receives the file URL directly; with an ID, it can ask WordPress to render the attachment or retrieve attachment information. Confirm the configured return format and actual value before writing the template or integration.

When an ID is useful—for example, when you want WordPress to generate responsive image markup—wp_get_attachment_image() can render the attachment and produce responsive srcset markup. A plain URL is often simpler for an external image composition service, but it provides less attachment context by itself.

Read ACF values inside a WordPress theme

For a server-rendered theme, use ACF’s documented get_field() or the_field() functions. The following example assumes a field named social_title and an Image field named social_image configured to return an attachment ID. It escapes text for HTML and lets WordPress build the image element:

<?php
$title = get_field('social_title');
$image_id = get_field('social_image');

if ($title) {
    echo '<h2>' . esc_html($title) . '</h2>';
}

if ($image_id) {
    echo wp_get_attachment_image($image_id, 'large');
}
?>

If the Image field is configured to return a URL, do not pass that URL to wp_get_attachment_image(), which expects an attachment ID. Use the URL in the appropriate HTML attribute and escape it for that context. If the field returns an array, inspect the array’s documented structure and use the relevant URL or ID. A mismatch between return format and code is a common reason for an empty image or invalid output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This theme-side route is convenient when the visual is rendered as part of the WordPress page. It is less suitable when a separate service, script, or headless application needs to request the values independently.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Expose selected ACF fields through the REST API

For a headless site or an external graphic workflow, expose only the fields the consumer needs. In the ACF field group settings, enable Show in REST API. REST support for ACF custom fields is documented from ACF 5.11 onward. By default, field groups are not exposed through the WordPress REST API; the setting is opt-in.

  1. Open the relevant field group in the WordPress admin.
  2. Enable Show in REST API in the group settings and save the group.
  3. Request the post through its WordPress REST endpoint, such as /wp-json/wp/v2/posts/POST_ID on your site.
  4. Inspect the response for the acf object and verify the field names and value shapes returned by your installed ACF configuration.

A simplified response may include data shaped like this:

{
  "id": 42,
  "acf": {
    "social_title": "A short headline",
    "social_summary": "Supporting copy for the visual",
    "social_image": 315
  }
}

The example is illustrative: field names and values depend on your field group, and an Image field’s basic REST schema expects an attachment ID. Do not assume the exact response without checking your site. ACF documents acf_format=standard to format values through ACF’s global formatter; image values may then contain more detail than the default lightweight representation. Inspect the response on the actual site before building a consumer around a particular shape.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For example, a request can ask WordPress for post 42 and then use its ACF object in an external process:

curl "https://example.com/wp-json/wp/v2/posts/42"

Replace example.com and the post ID with your site and content. If you have an attachment ID and need attachment information, use the WordPress media REST resource, for example /wp-json/wp/v2/media/315. The media endpoint is the relevant place to retrieve attachment details; consult the site’s REST schema for the available fields. An OPTIONS request can help reveal a route’s schema.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Turn the retrieved values into a graphic file

Once the data is available, the graphic-generation step is a separate implementation choice. The reviewed ACF and WordPress documentation establishes how to retrieve field values and attachment details, but it does not prescribe a particular rendering library or image-generation service. Your renderer needs to combine the text, image, brand elements, and layout into an asset suitable for the intended network.

  1. Fetch the post’s ACF values through the theme or REST API.
  2. If the image value is an attachment ID, resolve the attachment URL or retrieve its media details. If it is already a URL, validate that it is publicly reachable by the renderer.
  3. Pass the field values and image to your chosen rendering step, applying a defined layout and any desired brand styling.
  4. Save the finished asset and review it at the intended display size, including text cropping and image legibility.
  5. Upload that file directly to the social network when the goal is a standalone post image.

Keep the source data distinct from the composition rules. That makes it possible to change the card design without restructuring editorial content, and to reuse the same fields for more than one visual format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set the image for a shared-link preview

If the goal is that a page link displays the right image when shared, make the rendered page emit an Open Graph og:image tag containing the image URL. Open Graph also supports og:image:secure_url, og:image:type, og:image:width, og:image:height, and og:image:alt. The protocol says that when a page specifies og:image, it should specify og:image:alt as well.

If ACF stores a per-post share image, your theme or metadata layer can read that value and use it to populate the page’s social metadata. If an SEO or social metadata plugin already emits Open Graph tags, check its settings and rendered output first. Adding a second set of tags can leave crawlers with competing image declarations.

Open Graph defines what the page publishes; it does not guarantee that every platform will display the preview exactly the same way. The intended image must also be accessible to the platform’s crawler, and the page should be inspected after changes to confirm the rendered metadata is correct.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Check network-specific image requirements

Image dimensions and preview behavior are not universal across social networks. LinkedIn’s guidance calls for Open Graph compliance and a minimum sharing-image dimension of 1200 × 627 pixels. Treat that as LinkedIn-specific guidance, not a general rule for every platform. Before setting a single export size or file constraint, check the current official instructions for each network you plan to support.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There are two independent checks: verify that your data retrieval returns the expected ACF values, and verify that the publishing target can use the resulting image. For a direct-upload graphic, inspect the exported file. For a link preview, inspect the page’s emitted Open Graph tags and confirm that the intended image URL is present.

Protect field data and credentials

ACF values are not publicly visible through the REST API by default. Enabling REST exposure changes that: make only suitable fields public. A graphic-generation process may need a headline and image reference, but not private editorial notes or internal workflow fields. Review the field group and individual field exposure deliberately.

For REST write operations, ACF’s integration uses WordPress core authentication methods. Requests made outside a logged-in session need authentication; the ACF guide describes WordPress Application Passwords and a JWT plugin as possible methods. Keep credentials out of browser-side JavaScript and other client-visible code. If the consumer only needs read access, avoid granting it write access unnecessarily.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common problems and how to fix them

  • The REST response has no acf object: check that Show in REST API is enabled for the relevant field group, and that the field group applies to the requested content. Confirm the installed ACF version supports REST integration; ACF documents it from version 5.11.
  • The image is a number instead of a URL: the Image field may be configured to return an attachment ID, which is the basic REST schema format. Resolve the ID through the WordPress media endpoint or use it with WordPress attachment functions rather than treating it as a URL.
  • Theme image markup is empty or invalid: check the Image field’s configured return format. An array, URL, and ID require different handling. In particular, wp_get_attachment_image() expects an attachment ID.
  • The shared page shows the wrong image: inspect the rendered HTML for duplicate or conflicting Open Graph metadata, including tags produced by an SEO or social plugin. Confirm that og:image points to the intended accessible image.
  • A crawler does not show a preview: confirm that the page emits Open Graph metadata and that the image URL is reachable by the platform. Check the target platform’s current guidance; preview behavior and requirements can differ.
  • An external consumer cannot access the values: determine whether the fields are intentionally public. For protected reads or writes, configure appropriate WordPress authentication and keep credentials server-side.

Or skip the browser setup

If your workflow needs a screenshot of a rendered page or a browser-based visual capture, ScreenshotNeo can return a screenshot or PDF with one GET request. It is not a replacement for retrieving ACF fields or composing a custom social graphic, but it can capture a page after your WordPress template renders the content. The API accepts capture options for full-page shots, CSS selectors, device and viewport settings, waits, custom CSS and JavaScript, and more. See the ScreenshotNeo API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/post/ -o shot.webp

Before capture, ScreenshotNeo accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 shots. Every feature is on every plan.

Sign up for ScreenshotNeo free to get 1,000 screenshots a month with no card.

Frequently asked questions

Can ACF generate a social media image by itself?

No. ACF supplies and exposes structured field values; you still need an image-rendering step to create a standalone graphic file.

Do I need REST API access if the image is rendered by my theme?

No. A server-rendered theme can use ACF functions such as get_field() or the_field(). REST exposure is for workflows that need to retrieve the values through the API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Is a WordPress image attachment ID the same as its image URL?

No. An attachment ID identifies a media item; retrieve attachment information or use WordPress image functions to obtain or render the image.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.