Customizing The Restriction (Sorry) Page of PDF viewer for WordPress

by | Last updated Apr 20, 2023 | Solutions, Tutorial / How to | 0 comments

If you’re running a website that offers PDF files for download or viewing, you might want to restrict access to certain files to certain users. Fortunately, PDF viewer for WordPress and WP File Access Manager makes this easy to do.

With these two plugins, you can set permissions on your PDF files so that only certain users can view them. If a user tries to access a PDF file they’re not allowed to see, they’ll see a “sorry” page instead. And with the .pvfw-not-allowed CSS class, you can customize this page to match your site’s look and feel.

Here’s how to get started:

  1. Install PDF viewer for WordPress and WP File Access Manager

If you haven’t already, install these two plugins on your WordPress site. They’re available on CodeCanyon.

  1. Upload your PDF files

Once you have the plugins installed, upload your PDF files to your WordPress site using PDF viewer for WordPress. Be sure to set the file’s permissions using WP File Access Manager.

  1. Customize the “sorry” page

To customize the sorry page, you need to add some code to your website. The code can be found at this GitHub link:

Once you have the code, you can add it to your website by following these steps:

  1. Copy the code from the GitHub link.
  2. Log in to your website’s WordPress dashboard.
  3. Go to Appearance > Theme Editor.
  4. Click on the “functions.php” file on the right-hand side.
  5. Scroll down to the bottom of the file and paste the code you copied earlier.
  6. Click the “Update File” button to save the changes.

That’s it! You have now customized the sorry page for protected PDF files. Viewers who are not allowed to see the PDF will be redirected to this page, and you can customize it however you like using CSS.



Submit a Comment

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.

Related Posts

Check out our Plugins

PDF viewer for WordPress is the best-selling premium PDF Reader plugin for WordPress on CodeCanyon (7000+ Sales) since 2014.

Custom quotation system on woo-commerce with a separate basket for asking price.

Upload files for specific visitors and restrict them from others by controlling the access with this plugin.

OfferPress is a WooCommerce add-on. This plugin makes the discount offer-giving process very easy.

Create PDF viewer for WordPress Shortcodes right from your Divi Module.

Popular Post