From the Knowledgebase

Error: URL to the PDF file must be on exactly the same domain as the current web page

You will usually see this error in your browser because your PDF does not sit on the same domain as the current page on your site.

For example, if you access the page http://www.mycompany.com/ and see the error message:
Error: URL to the PDF file must be on exactly the same domain as the current web page or Failed to Fetch (as of update v. 3.1.8 this error may appear as "Failed to Fetch") while retrieving PDF "http://mycompany.com/wp-content/uploads/mydoc.pdf"
this is because the shortcode for the embedded document references the URL on mycompany.com whereas the page is sitting on www.mycompany.com.

The "www" is important - it references a different domain to the PDF's URL that does not contain "www".

For security reasons, browsers are not allowed to load the PDF from a different domain.

Let's say your site is available via both www.mycompany.com and mycompany.com. Then that's an inconsistency that is also confusing to search engines and users.

To fix this, ask your web hosting company to make it consistent - for example, to redirect users direct from www.mycompany.com to mycompany.com, so everyone is using the same domain.

Then, you will need to ensure all your [pdf-embedder] shortcodes refer to the PDF's URL in the new preferred manner.

Sometimes, the problem might be that WordPress is configured to upload PDFs to media.mycompany.com, or something similar, perhaps due to a content-delivery plugin that is attempting to speed up your site. It may still be possible to load PDFs hosted on a different domain, at least if you have the ability to set up the configuration of that domain - see Hosting PDFs on other services such as Amazon S3.

It is also possible that a PDF URL is being prevented from loading by a browser Ad Blocker. In the browser console, this shows up as an error net::ERR_BLOCKED_BY_CLIENT. To fix this, be sure that the PDF file name does not contain any words such as advertisement, advert, ad, click, doubleclick which are trigger words for Ad Blockers.

Top