enter image description here

I am trying to read wordpress feed url into php

This is link of
Wordpress Feed URL

When we click on this url it redirects to login page where as it should have shown the contents of feed.

Below is my php code to read this feed url

<?php 

$xmlDoc = new DOMDocument();

libxml_use_internal_errors(true);
$xmlDoc->loadHTMLFile("https://intranet.saniservice.com/feed/rss2");
libxml_use_internal_errors(false);

print_r($xmlDoc);

?> 

When this code is executed it returns data but that data is of login page which we see when we click on feed url, I am not sure how can i stop this feed from redirecting to login page.

Read more here: WordPress Feed URL redirecting to Login Page


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: