Title: Trigger the link processing programmatically in PHP for REST calls
Last modified: September 16, 2025

---

# Trigger the link processing programmatically in PHP for REST calls

 *  Resolved [Twig](https://wordpress.org/support/users/twiginteractive/)
 * (@twiginteractive)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/trigger-the-link-processing-programmatically-in-php-for-rest-calls/)
 * Hi – I want to have WPEL process post content for external links from within 
   a REST call, but currently it seems that the plugin (although active during the
   REST call) is not applying the external logic, even if `$post_content=apply_filters('
   the_content', $raw_content);` is called – where $raw_content is the raw post 
   content retrieved via a public REST call.
   Is there a way to have WPEL treat this
   content as if it were within the Loop on a page?Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * (@talextech)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/trigger-the-link-processing-programmatically-in-php-for-rest-calls/#post-18644752)
 * Hi,
 * In External Links Settings -> Exceptions uncheck All Content for the Apply To
   option and just leave the sub-checkboxes checked 🙂
 *  Thread Starter [Twig](https://wordpress.org/support/users/twiginteractive/)
 * (@twiginteractive)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/trigger-the-link-processing-programmatically-in-php-for-rest-calls/#post-18645540)
 * [@talextech](https://wordpress.org/support/users/talextech/) 
   Thank you for this
   info – that seems to work! It’s a bit of a strange UX though, I would have thought
   having all sub-checkboxes checked would have the same effect as the parent being
   checked… and there’s no dox on why this would affect REST calls… but it works
   😀So there isn’t an exposed public method for this, like calling `\WPEL_Link-
   >scan()` or something, even in the Pro version? Just curious for future use…Thanks
   for all your hard work on this plugin!—-UPDATE: actually this approach doesn’t
   work as expected. By unchecking the parent box, other Blocks in included the 
   page template are not getting processed. ☹Is there a programmatic method we can
   use?
    -  This reply was modified 8 months, 1 week ago by [Twig](https://wordpress.org/support/users/twiginteractive/).
 *  Plugin Author [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * (@talextech)
 * [8 months, 1 week ago](https://wordpress.org/support/topic/trigger-the-link-processing-programmatically-in-php-for-rest-calls/#post-18646179)
 * Hi,
 * If All Contents is checked then we output buffer the whole content and just parse
   it at the end but it can mess things up in some cases like REST API and we have
   not found a proper fix for that.
 * If you uncheck that then we just use WordPress hooks like the_content to parse
   only that. But we don’t have a public method that you can call externally, sorry
   🙁

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Trigger the link processing programmatically in PHP for REST calls’ is
closed to new replies.

 * ![](https://ps.w.org/wp-external-links/assets/icon-256x256.png?rev=2103983)
 * [External Links - nofollow, noopener & new window](https://wordpress.org/plugins/wp-external-links/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-external-links/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-external-links/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-external-links/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-external-links/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-external-links/reviews/)

## Tags

 * [rest](https://wordpress.org/support/topic-tag/rest/)

 * 3 replies
 * 2 participants
 * Last reply from: [Alexandru Tapuleasa](https://wordpress.org/support/users/talextech/)
 * Last activity: [8 months, 1 week ago](https://wordpress.org/support/topic/trigger-the-link-processing-programmatically-in-php-for-rest-calls/#post-18646179)
 * Status: resolved