{"id":20432,"date":"2021-07-01T14:09:54","date_gmt":"2021-07-01T11:09:54","guid":{"rendered":"https:\/\/plumrocket.com\/docs\/?p=20432"},"modified":"2021-09-24T05:10:30","modified_gmt":"2021-09-24T09:10:30","slug":"how-to-disable-newsletter-popup-manually","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually","title":{"rendered":"How to Disable Newsletter Popup Manually"},"content":{"rendered":"\n<p>To disable the <a href=\"\/magento-newsletter-popup\">Magento 2 Newsletter popup<\/a> manually, you need to add this code to XML layout:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;referenceBlock name=\"newsletter.popup\">\n    &lt;action method=\"disable\" \/>\n&lt;\/referenceBlock><\/code><\/pre><\/div>\n\n\n<div class=\"example-block\">\n<p class=\"example-block-title\">Code Example<\/p>\n<div class=\"wp-block-prismatic-blocks\">\n<div><\/div>\n<pre data-line=\"3-5\"><code class=\"language-markup\">&lt;body&gt;\n        &lt;referenceContainer name=\"root\"&gt;\n            &lt;referenceBlock name=\"newsletter.popup\"&gt;\n                &lt;action method=\"disable\" \/&gt;\n            &lt;\/referenceBlock&gt;\n            ....\n        &lt;\/referenceContainer&gt;\n    &lt;\/body&gt;<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n<p>In order to disable Newsletter Popup Extension using controller class, please use the following code:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">$newsletterBlock = $this->_view->loadLayout()->getLayout()->getBlock('newsletter.popup');\nif ($newsletterBlock) {\n    $newsletterBlock->disable();\n}<\/code><\/pre><\/div>\n\n\n<div class=\"example-block\">\n<p class=\"example-block-title\">Code Example<\/p>\n<div class=\"wp-block-prismatic-blocks\">\n<div><\/div>\n<pre data-line=\"8-12\"><code class=\"language-php\">namespace MagentoContactControllerIndex;\n    \n    class Index extends MagentoContactControllerIndex\n    {\n         public function execute()\n         {\n              $this-&gt;_view-&gt;loadLayout();\n              $newsletterBlock = $this-&gt;_view-&gt;loadLayout()-&gt;getLayout()\n                  -&gt;getBlock('newsletter.popup');\n    \n             if ($newsletterBlock) {\n                 $newsletterBlock-&gt;disable();\n             }\n    \n             $this-&gt;_view-&gt;renderLayout();\n         }\n    }<\/code><\/pre>\n<\/div>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: Code Example &lt;body&gt; &lt;referenceContainer name=&#8221;root&#8221;&gt; &lt;referenceBlock name=&#8221;newsletter.popup&#8221;&gt; &lt;action method=&#8221;disable&#8221; \/&gt; &lt;\/referenceBlock&gt; &#8230;. &lt;\/referenceContainer&gt; &lt;\/body&gt; In order to disable Newsletter Popup Extension using controller class, please use the following code: Code Example namespace MagentoContactControllerIndex; class Index extends MagentoContactControllerIndex { &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Disable Newsletter Popup Manually&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[286],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Disable Newsletter Popup Manually - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: &lt;referenceBlock name=&quot;newsletter.popup&quot;&gt; &lt;action\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Disable Newsletter Popup Manually\" \/>\n<meta property=\"og:description\" content=\"To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: &lt;referenceBlock name=&quot;newsletter.popup&quot;&gt; &lt;action\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-01T11:09:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-24T09:10:30+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Disable Newsletter Popup Manually - Plumrocket Documentation","description":"To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: &lt;referenceBlock name=\"newsletter.popup\"> &lt;action","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually","og_locale":"en_US","og_type":"article","og_title":"How to Disable Newsletter Popup Manually","og_description":"To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: &lt;referenceBlock name=\"newsletter.popup\"> &lt;action","og_url":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually","og_site_name":"Plumrocket Documentation","article_published_time":"2021-07-01T11:09:54+00:00","article_modified_time":"2021-09-24T09:10:30+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually","name":"How to Disable Newsletter Popup Manually - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2021-07-01T11:09:54+00:00","dateModified":"2021-09-24T09:10:30+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20"},"description":"To disable the Magento 2 Newsletter popup manually, you need to add this code to XML layout: &lt;referenceBlock name=\"newsletter.popup\"> &lt;action","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide\/disable-manually#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 Newsletter Popup","item":"https:\/\/plumrocket.com\/magento-newsletter-popup"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup"},{"@type":"ListItem","position":4,"name":"v4","item":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4"},{"@type":"ListItem","position":5,"name":"Developer Guide","item":"https:\/\/plumrocket.com\/docs\/magento-newsletter-popup\/v4\/devguide"},{"@type":"ListItem","position":6,"name":"Disable Manually"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","caption":"Plumrocket"},"sameAs":["https:\/\/plumrocket.com\/docs"]}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/20432"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=20432"}],"version-history":[{"count":2,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/20432\/revisions"}],"predecessor-version":[{"id":24377,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/20432\/revisions\/24377"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=20432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=20432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=20432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}