{"id":824,"date":"2024-05-07T11:43:58","date_gmt":"2024-05-07T11:43:58","guid":{"rendered":"https:\/\/kb.shortpixel.com\/docs\/wp-how-to-hide-api-key\/"},"modified":"2026-02-04T09:41:35","modified_gmt":"2026-02-04T09:41:35","password":"","slug":"wp-how-to-hide-api-key","status":"publish","type":"docs","link":"https:\/\/kb.shortpixel.com\/knowledge-base\/article\/wp-how-to-hide-api-key\/","title":{"rendered":"How to hide the API key with ShortPixel Image Optimizer?"},"content":{"rendered":"\n<p>The API Key inside the <a href=\"https:\/\/wordpress.org\/plugins\/shortpixel-image-optimiser\/\" target=\"_blank\" rel=\"noopener\">ShortPixel Image Optimizer<\/a> plugin <strong>can<\/strong> be hidden in two simple steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <code>wp-config.php<\/code> file (either use your file manager from your hosting control panel, an FTP client or a plugin like <a href=\"https:\/\/wordpress.org\/plugins\/wp-file-manager\/\" target=\"_blank\" rel=\"noopener\">File Manager<\/a>).<\/li>\n\n\n\n<li>Add a new line, just after the beginning <code>&lt;?php<\/code> tag, the following.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>define('SHORTPIXEL_HIDE_API_KEY', true);<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>This will also hide the &#8220;ShortPixel Account&#8221; button displayed within our plugin&#8217;s settings.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The API Key inside the ShortPixel Image Optimizer plugin can be hidden in two simple steps: This will also hide the &#8220;ShortPixel Account&#8221; button displayed within our plugin&#8217;s settings.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[37],"glossaries":[],"doc_tag":[],"class_list":["post-824","docs","type-docs","status-publish","hentry","doc_category-shortpixel-image-optimizer"],"blocksy_meta":[],"year_month":"2026-04","word_count":72,"total_views":"775","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"admin","author_nicename":"admin_mdli53m5","author_url":"https:\/\/kb.shortpixel.com\/author\/admin_mdli53m5\/"},"doc_category_info":[{"term_name":"ShortPixel Image Optimizer","term_url":"https:\/\/kb.shortpixel.com\/knowledge-base\/category\/shortpixel-image-optimizer\/"}],"doc_tag_info":[],"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/comments?post=824"}],"version-history":[{"count":2,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/824\/revisions"}],"predecessor-version":[{"id":2860,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/docs\/824\/revisions\/2860"}],"wp:attachment":[{"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/media?parent=824"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_category?post=824"},{"taxonomy":"glossaries","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/glossaries?post=824"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/kb.shortpixel.com\/wp-json\/wp\/v2\/doc_tag?post=824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}