Image search functionality in DigiBlocks allows you to search and insert high-quality images directly from supported providers within the Image block. If this feature isn’t working properly, there are several potential causes and solutions to explore.
Understanding Image Search Requirements
Image search in DigiBlocks requires proper configuration of an image API provider. The plugin supports three providers:
- Unsplash – Free tier: 50 requests/hour
- Pexels – Free tier: 200 requests/hour
- Pixabay – Free tier: 5,000 requests/hour
Common Causes and Solutions
Provider Not Configured
The most common reason image search doesn’t work is that no image API provider has been configured or the configuration is incomplete.
Solution:
- Navigate to DigiBlocks > Settings
- Scroll to the Image API Settings section
- Select an image provider from the dropdown
- Enter the required credentials for your chosen provider
- Save the settings
Missing or Invalid API Credentials
Each provider requires specific credentials that must be obtained from their respective developer portals.
For Unsplash:
- Application ID (optional)
- Access Key (required)
- Secret Key (optional, for advanced features)
Get credentials from: https://unsplash.com/developers
For Pexels:
- API Key (required)
Get credentials from: https://www.pexels.com/api/
For Pixabay:
- API Key (required)
Get credentials from: https://pixabay.com/api/docs/
Browser Console Errors
Check your browser’s developer console for JavaScript errors that might prevent the image search from functioning.
Solution:
- Open your browser’s developer tools (F12)
- Go to the Console tab
- Try using the image search feature
- Look for any error messages
- Common errors include network issues, authentication failures, or API rate limit exceeded
Network and Firewall Issues
Your server might be blocking outbound requests to the image provider APIs.
Solution:
- Contact your hosting provider to ensure outbound HTTPS requests are allowed
- Check if your server’s firewall blocks requests to:
api.unsplash.com
(for Unsplash)api.pexels.com
(for Pexels)pixabay.com
(for Pixabay)
WordPress REST API Issues
Image search functionality relies on WordPress REST API endpoints. If these are disabled or restricted, the feature won’t work.
Solution:
- Ensure WordPress REST API is enabled
- Check if any security plugins are blocking REST API requests
- Verify that the user has proper permissions to access the API
Plugin Conflicts
Other plugins might interfere with the image search functionality.
Solution:
- Temporarily deactivate all other plugins
- Test the image search feature
- If it works, reactivate plugins one by one to identify the conflicting plugin
- Contact the conflicting plugin’s support or DigiBlocks support for compatibility solutions
Server PHP Configuration
Certain PHP configurations might prevent the image search from working properly.
Solution:
- Ensure your server has the
curl
extension enabled - Check that
allow_url_fopen
is enabled in PHP configuration - Verify that your server can make outbound HTTPS requests
- Ensure adequate memory limits for processing API responses
Rate Limit Exceeded
If you’ve exceeded your API provider’s rate limits, image search will temporarily stop working.
Solution:
- Check your usage against your provider’s limits
- Wait for the rate limit to reset (usually hourly)
- Consider upgrading to a paid plan with higher limits
- Implement caching strategies to reduce API calls
Outdated Browser or JavaScript Disabled
The image search feature requires modern JavaScript functionality.
Solution:
- Ensure JavaScript is enabled in your browser
- Update to a modern browser version
- Clear browser cache and cookies
- Try using a different browser to isolate the issue
Provider-Specific Issues
Unsplash Issues
- Invalid Application ID: While optional, if provided, it must be valid
- Access Key Format: Ensure the access key is copied correctly without extra spaces
- Secret Key: Only needed for advanced features; can be left empty for basic functionality
Pexels Issues
- API Key Validation: Pexels validates API keys strictly; ensure it’s active and valid
- Request Format: Pexels has specific requirements for search queries
Pixabay Issues
- Account Verification: Ensure your Pixabay account is verified
- API Key Status: Check that your API key is active in your Pixabay account settings
Testing the Configuration
After configuring your image provider:
- Edit a page or post
- Add an Image block
- Look for the image search functionality within the block
- Try searching for a common term like “nature” or “business”
- Check if results appear and images can be inserted
Alternative Solutions
If image search continues not to work:
- Use a different provider: Switch to another supported image provider
- Manual image upload: Continue using the standard WordPress media library
- Browser-based search: Search for images manually on the provider’s website and download them for upload
Getting Additional Help
If none of these solutions resolve your image search issues:
- Check the browser console for specific error messages
- Verify your server meets all technical requirements
- Ensure your chosen provider’s service is operational
- Contact your hosting provider about potential server-side restrictions
The image search feature enhances your workflow by providing access to high-quality stock images directly within the WordPress editor, but it requires proper configuration and a stable connection to external API services.