Back to Top

How to allow External domain in WordPress?

Allow External domain in Wordpress

Hello All, Happy New Year 🙂 .In this quick article I will show, how to allow external url/host in wordpress.Recently i was working with wordpress for getting data from external feed url.

So, When I tried to access data from same domain,it was working fine but when i tried to access data from other domain/host, I got following error:

I googled to get solution for above error in wordpress and what does it mean. This error occur because by default external urls are disabled in wordpress for security reason.So you need to allow external host/domain explicitly using following line of code into your functions.php file or your plugin’s main file:

Here,I have used http_request_host_is_external filter which is used to check HTTP request is external or not.In condiiton pass your external domain you want to allow.

So that’s it for now from my side. Hope this article will be useful to someone.

Suggested Reading:

Post via e-mail in WordPress
Customize Contact Form 7 in WordPress
User Roles in WordPress

If you have any query or question,tell us in the comment section :). Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

New Features in WordPress 3.5

Posted on 11 years ago

Bhumi

Steps To speed up Eclipse IDE

Posted on 12 years ago

Bhumi