How to Add Link Preview Cards to SMF 2.1 with Better Links

Started by admin, Oct 13, 2026, 06:40 AM

Previous topic - Next topic

admin

How to Add Link Preview Cards to SMF 2.1 with Better Links

Better Links gives SMF 2.1 a cleaner way to display links shared in forum posts.

Instead of leaving members with a long URL, Better Links can automatically retrieve information from the destination and create a preview card containing things such as the page title, description, and image.

The system is intentionally simple, but there are a few settings worth understanding — especially cURL support and maintenance of downloaded preview files.

1. Open Better Links in the Admin Center

After installing Better Links, open the SMF Admin Center and go to the Better Links configuration area.

This is where you control how link previews behave.

2. Enable link previews

Make sure Better Links is enabled.

Once active, supported URLs posted by members can be detected automatically and turned into preview cards.

Members do not need to use special BBC.

They can simply paste a normal URL into their message.

For example:

https://example.com/article
Better Links can then attempt to retrieve information from that page and build the preview.

3. Choose where preview cards are displayed

Depending on your Better Links configuration, preview cards can be displayed separately from the main message content.

This can be useful for longer posts because it keeps the written article or discussion clean while placing link previews together underneath the message.

Choose the presentation that works best for your forum.

4. Understand what happens when a preview cannot be created

Not every website allows automated preview requests.

Some websites block external requests, while others do not provide useful metadata.

Better Links is designed so that a failed preview does not destroy the original link.

If a useful card cannot be created, the URL should remain available as a normal clickable link.

That is important because link previews should improve a post — not become a requirement for the link itself to work.

5. Better Links requires PHP cURL

Better Links needs the server to retrieve information from the website being linked.

To do that, PHP needs access to the cURL extension.

Better Links includes a cURL check so administrators can verify whether the server supports it.

If the check reports that cURL is available, you are ready to use link previews.

If it reports that cURL is unavailable, it normally needs to be enabled through your hosting account or by your hosting provider.

6. How to enable cURL in cPanel

The exact hosting interface varies, but many shared hosts use cPanel.

If your host allows PHP extensions to be managed directly, look for something similar to:

  • cPanel
  • Select PHP Version or PHP Selector
  • Extensions

Find:

curl

and make sure it is enabled.

Save the PHP configuration if your host requires it.

Then return to Better Links and run the cURL check again.

Important: Not every cPanel installation gives customers permission to enable PHP extensions themselves.

If you do not see an extension manager, do not start changing unrelated PHP settings.

7. Ask your hosting provider to enable cURL

If you cannot enable it yourself, contact your hosting company.

You can simply tell them:

QuotePlease enable the PHP cURL extension for the PHP version used by my website.

That is usually all they need.

You may also want to include the domain name and current PHP version if you know them.

For example:

QuoteCould you please enable the PHP cURL extension for my SMF installation on https://www.example.com? The site is currently using PHP 8.x.

Once the host confirms that it has been enabled, return to Better Links and run the cURL test again.

8. Test a normal link

Once Better Links is configured and cURL is working, create a test forum post containing a normal URL.

Use a page that provides a title, description, and image if possible.

After posting, Better Links should build a preview card automatically.

A successful preview may contain:

  • Page title
  • Description
  • Preview image
  • Destination information

9. Inline images are left alone

Better Links understands that not every URL in a message is supposed to become a preview.

For example:



is an intentional inline image.

Better Links leaves URLs used inside SMF image BBC alone instead of trying to turn the image source into a preview card.

That means tutorials and screenshot-heavy articles can use inline images normally while regular links continue to receive previews.

10. What are orphaned files?

When Better Links retrieves preview information, it may store supporting files used by previews.

Over time, a forum post may be deleted, edited, or changed so that one of those stored files is no longer being used.

A file that is still stored by Better Links but is no longer associated with active preview content is considered an orphaned file.

Leaving a few orphaned files behind is not usually a serious problem, but over a long period they can consume unnecessary disk space.

That is why Better Links includes maintenance tools to help identify them.

11. Find orphaned Better Links files

Open the Better Links maintenance or cleanup area and run the orphaned-file scan.

Better Links will compare the files it has stored against the preview information still being used by the forum.

Anything that is no longer referenced can be identified as an orphan.

Running the scan first lets you see what Better Links considers unused before deleting anything.

12. Delete orphaned files

Once the scan has finished, use the cleanup option to remove files that are confirmed to be orphaned.

This removes unused Better Links files without affecting preview data that is still actively referenced.

It is a good maintenance task to run occasionally, especially on a busy forum where posts and links are edited or deleted frequently.

There is usually no reason to run it constantly.

Periodic cleanup is enough.

13. Test Better Links as a normal member

Before considering the setup finished, log in with a regular member account and make a few test posts.

Try:

  • A normal URL that produces a preview
  • A URL from a site that does not provide a preview
  • A post containing an inline image
  • A longer article containing both images and normal links

Confirm that normal links stay clickable, previews appear when possible, and intentional BBC formatting is left alone.

14. If previews suddenly stop working

If Better Links previously worked and previews suddenly stop appearing, a few things are worth checking first:

  • Run the Better Links cURL check
  • Confirm your hosting provider has not changed the PHP version
  • Verify the PHP cURL extension is still enabled
  • Try more than one external website
  • Remember that individual websites may block preview requests

If one website fails but others work, the problem is probably the destination website rather than Better Links.

If every website fails, checking cURL and the server configuration is a good place to start.

Simple by design

Better Links does not require members to learn a new posting system.

Paste a normal link.

If Better Links can build a useful preview, it does.

If it cannot, the link remains a link.

Administrators get the settings and maintenance tools needed to keep the system working without making normal forum posting more complicated.

Paste the link. Better Links does the rest.

Want to learn more about Better Links?

View the Better Links for SMF 2.1 landing page
Having trouble? Please contact me through Help & Support Board.