Skip to content
Help Center
  • Pricing
  • ProductsExpand
    • Premium PlansGet all the tools you need in one plan
    • Kadence ThemeLightning-fast performance theme for modern websites
    • Kadence BlocksDrop in ready designs with advanced controls for pixel perfect websites
    • Kadence Shop KitCreate a more effective WooCommerce shopping experience
    • Kadence ConversionsBoost sales and build engaged audiences with popups and banners
    • Kadence InsightsEasily create A/B tests. Optimize your pages to drive higher conversions.
    • View All Products
    • Get Kadence + Hosting
      In One Place

      Enjoy faster setup, top-tier performance, and worry-free WordPress hosting – Kadence Theme, Kadence Blocks, and Solid Security all pre-installed.

      Learn More

  • Kadence AI
  • Starter Templates
  • Blog
  • SupportExpand
    • Resource HubStart here for guides, Product docs, FAQs, and Troubleshooting tips, all in one place.
    • Contact SupportStuck on something? We’re here to help! Open a ticket for top-notch support.
    • Contact Our TeamGot pre-sales questions or need help choosing a plan? Open a ticket and our team will guide you.
    • About usCrafted with love in Missoula, Montana. Meet the team behind the mission.
Account Account
Get Kadence
Kadence Pattern Hub
  • Features
  • Use Cases
  • HelpExpand
    • Documentation
    • Facebook Group
    • Submit a Ticket
    • Feature Requests
    • Changelog
Help Center
Kadence Pattern Hub

Pattern Hub

  • How to Create Your Own Pattern Hub
  • Kadence Pattern Hub Pages
  • Creating Categories and Search Terms
  • How to Set the Order of Pattern Hub Items
  • How to Generate Pattern Hub Preview Thumbnails
  • How to Remove Access Keys
  • Resolving the No Connection Data Error in Pattern Hub

Selling Access

  • How to Sell Access Keys (Woocommerce)
  • How to Sell Access Keys (SureCart)
  • How to Offer Free Items and Show Premium Items
  • How To Sell Keys From One Site For Libraries Hosted On Another

Advanced Access Keys

  • How To Limit Access Keys to Specific Collections
  • How To Limit an Access Key to a Specific Site
  • Home
  • Knowledge Base
  • Kadence Pattern Hub
  • Kadence Cloud
  • Advanced Access Keys

How To Limit an Access Key to a Specific Site

Using the Code Snippet plugin you can filter the access key verification check to make sure access is only given to a specific site.

Add a PHP snippet with the following code, just changing your ACCESS_KEY and WEBSITE.COM with the key you want to limit and the site you want to limit it to.

/**
 * Checks for specific key and makes sure that key only works on a specific site.
 *
 * @param Boolean $access true or false based on access.
 * @param String $key the access key.
 * @param WP_REST_Request $request full details about the request.
 * @return Boolean based on if access should be granted.
 */
function custom_kadence_cloud_access_filter( $access, $key, $request ) {
    if ('ACCESS_KEY' === $key ) {
        $site = preg_replace("(^https?://)", "", $request->get_param( 'site' ) );
        if ( $site && 'WEBSITE.COM' === $site ) {
            return true;
        } else {
            return false;
        }
    }
    return $access;
}
add_filter( 'kadence_cloud_rest_request_access', 'custom_kadence_cloud_access_filter', 10, 3 );
Do you feel this document was helpful?
How To Limit Access Keys to Specific Collections
The Kadence WP Logo
Crafted in Missoula, Montana
  • Follow Kadence on Facebook
  • Follow Kadence on Youtube
  • X
  • Follow Kadence on Instagram
Trustpilot
Products
  • Kadence Plans
  • Kadence Theme
  • Kadence Blocks
  • Kadence AI
  • Kadence Starter Templates
  • Kadence Shop Kit
  • Kadence Conversions
  • Kadence Pattern Hub
  • View All
Resources
  • Blog
  • Podcast
  • Knowledgebase
  • Support ticket
  • Feature Requests
  • FAQ
  • WordPress Hosting Services
About Us
  • About Kadence
  • Become an affiliate
  • Contact us
  • Terms
  • Privacy Policy
  • Security
Our Partner Brands
  • SolidWP
  • LearnDash
  • The Events Calendar
  • GiveWP
  • MemberDash
Kadence Community
  • Kadence Marketplace
  • Join the Facebook Group
  • Subscribe to our YouTube Channel
© 2024 Kadence WP | All prices are in USD
Logo for StellarWP an umbrella brand of Premium WordPress plugins
  • Pricing
  • Products
    • Premium PlansGet all the tools you need in one plan
    • Kadence ThemeLightning-fast performance theme for modern websites
    • Kadence BlocksDrop in ready designs with advanced controls for pixel perfect websites
    • Kadence Shop KitCreate a more effective WooCommerce shopping experience
    • Kadence ConversionsBoost sales and build engaged audiences with popups and banners
    • Kadence InsightsEasily create A/B tests. Optimize your pages to drive higher conversions.
    • View All Products
    • Get Kadence + Hosting
      In One Place

      Enjoy faster setup, top-tier performance, and worry-free WordPress hosting – Kadence Theme, Kadence Blocks, and Solid Security all pre-installed.

      Learn More

  • Kadence AI
  • Starter Templates
  • Blog
  • Support
    • Resource HubStart here for guides, Product docs, FAQs, and Troubleshooting tips, all in one place.
    • Contact SupportStuck on something? We’re here to help! Open a ticket for top-notch support.
    • Contact Our TeamGot pre-sales questions or need help choosing a plan? Open a ticket and our team will guide you.
    • About usCrafted with love in Missoula, Montana. Meet the team behind the mission.
Account Login
  • Features
  • Use Cases
  • HelpExpand
    • Documentation
    • Facebook Group
    • Submit a Ticket
    • Feature Requests
    • Changelog