Skip to content

WordPress Gutenberg block plugin that fetches and displays content from any external URL

Notifications You must be signed in to change notification settings

roldan/external-content-block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

External Content Block

External Content Block is a WordPress Gutenberg block plugin that fetches and displays content from any external URL. Simply add the block, enter a URL, and the content will be loaded server-side and displayed on your site.

Key Features:

  • Easy-to-use block interface with real-time URL validation
  • Configurable HTML sanitization (strict by default, or raw HTML output)
  • Customizable timeout (1-60 seconds) and WordPress transients caching support
  • Enhanced security with URL validation and error handling
  • Works with any WordPress theme

Important: Content is loaded server-side using PHP, which means the source URL is not visible to end users, requests originate from your WordPress server's IP address (useful for IP-based authentication), and currently only GET requests are supported.

Installation

  1. Download or clone this repository
  2. Upload the external-content-block folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Start using the "URL Block" in the Gutenberg editor

Usage

  1. In the Gutenberg editor, click the "+" button to add a new block
  2. Search for "URL Block" or find it in the "Widgets" category
  3. Enter the URL you want to load content from
  4. Configure the block settings:
    • URL: The full URL of the content you want to display (e.g., https://example.com/content)
    • Sanitize HTML (default: enabled): When enabled, HTML is sanitized using wp_kses_post() for security. When disabled, content is injected exactly as received (including scripts and all HTML tags). ⚠️ Warning: Only disable if you trust the source URL.
    • Timeout (seconds) (default: 5, range: 1-60): Maximum time to wait for the request to complete. If exceeded, an error will be displayed.
    • Cache TTL (seconds) (default: 0, range: 0-86400): When set to a value greater than 0, content is cached using WordPress transients. Set to 0 to disable caching. Examples: 3600 = 1 hour, 86400 = 24 hours.
  5. The content will be displayed on the frontend of your site

Requirements

  • WordPress 5.0 or higher (Gutenberg editor)
  • PHP 7.0 or higher

Author

Matías Roldán

License

This plugin is licensed under the GPLv2 or later.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

About

WordPress Gutenberg block plugin that fetches and displays content from any external URL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published