{"id":274741,"date":"2021-01-27T14:09:51","date_gmt":"2021-01-27T14:09:51","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=274741"},"modified":"2025-03-12T11:59:14","modified_gmt":"2025-03-12T11:59:14","slug":"module-registration-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/","title":{"rendered":"Create Custom Module in Magento 2"},"content":{"rendered":"\n<p>Creating a custom module in Magento 2 involves several structured steps to ensure that the module is properly defined, registered, and activated.<\/p>\n\n\n\n<p>In <a href=\"https:\/\/store.webkul.com\/Magento-2.html\">Magento 2 modules<\/a> are a standalone unit where we write our functionalities or business logic to achieve our goal.<\/p>\n\n\n\n<p>It is a group of directories that contain the blocks, controllers, helpers, and models needed to create a specific store feature. It is the unit of customization in the Magento 2 platform.<\/p>\n\n\n\n<p>You can create Magento 2 modules to perform various functions, such as influencing user experience and changing the storefront appearance. They can install, deleted, or disabled.<\/p>\n\n\n\n<p>Here\u2019s a detailed guide on how to create a simple custom module.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps to Create a Module<\/strong> :<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create the module folder.<\/li>\n\n\n\n<li>Create the registration.php file.<\/li>\n\n\n\n<li>Create the module.xml file.<\/li>\n\n\n\n<li>Run the command: php bin\/magento setup:upgrade<\/li>\n\n\n\n<li>Run the command: php bin\/magento setup:di:compile<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create the module Folder<\/strong> :<\/h3>\n\n\n\n<p>To create the module we have to create a vendor folder first with the vendor name (which is Webkul in our case) under the app\/code folder.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"248\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png\" alt=\"Folder structure\" class=\"wp-image-391493\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-300x62.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-250x52.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-768x159.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123.png 1292w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-left\"><strong>Note &#8211; <\/strong>(if the code folder is not available then please create it).<\/p>\n\n\n\n<p>Then we have to create the module folder &#8220;BlogManager&#8221; (the module name).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"862\" height=\"113\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_121-1.png\" alt=\"Folder structure\" class=\"wp-image-391492\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_121-1.png 862w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_121-1-300x39.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_121-1-250x33.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_121-1-768x101.png 768w\" sizes=\"(max-width: 862px) 100vw, 862px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Folder Structure<\/figcaption><\/figure>\n\n\n\n<p>Now our folder structure should be like (app\/code\/Webkul\/BlogManager). Where Webkul is our Vendor name and <a href=\"https:\/\/webkul.com\/blog\/blog-manager-for-magento2\/\">BlogManager<\/a> is our Module name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create the registration.php file<\/strong> :<\/h3>\n\n\n\n<p>After this, we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager) so that Magento 2 can recognize it as a module and register it.<\/p>\n\n\n\n<p>Code for <em>app\/code\/Webkul\/BlogManager\/registration.php<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\\Magento\\Framework\\Component\\ComponentRegistrar::register(\n    \\Magento\\Framework\\Component\\ComponentRegistrar::MODULE,\n    &#039;Webkul_BlogManager&#039;,\n    __DIR__\n);<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1095\" height=\"131\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_124.png\" alt=\"Folder structure\" class=\"wp-image-391496\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_124.png 1095w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_124-300x36.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_124-250x30.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_124-768x92.png 768w\" sizes=\"(max-width: 1095px) 100vw, 1095px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Folder structure<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Create the module.xml file.<\/strong> :<\/h3>\n\n\n\n<p>To create the module.xml file, we first need to create an etc folder under the directory (app\/code\/Webkul\/Blogmanager), and in the etc folder we need to create a module.xml file with the following content.<\/p>\n\n\n\n<p>Code for <em>etc\/module.xml<\/em> file<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot;?&gt;\n&lt;config xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;urn:magento:framework:Module\/etc\/module.xsd&quot;&gt;\n    &lt;module name=&quot;Webkul_BlogManager&quot;&gt;\n    &lt;\/module&gt;\n&lt;\/config&gt;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1048\" height=\"160\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_125.png\" alt=\"Folder structure\" class=\"wp-image-391497\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_125.png 1048w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_125-300x46.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_125-250x38.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_125-768x117.png 768w\" sizes=\"(max-width: 1048px) 100vw, 1048px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Folder structure<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"917\" height=\"180\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_127.png\" alt=\"Magento Root Directory Path\" class=\"wp-image-391686\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_127.png 917w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_127-300x59.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_127-250x49.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_127-768x151.png 768w\" sizes=\"(max-width: 917px) 100vw, 917px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">For better understanding<\/figcaption><\/figure>\n\n\n\n<p><strong>Run the command: php bin\/magento setup:upgrade<\/strong><\/p>\n\n\n\n<p>After creating these two files we need to run the setup upgrade command like below in the terminal at the Magento 2 root folder. It will activate the module.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:upgrade<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"174\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1-1200x174.png\" alt=\"Command Execution\" class=\"wp-image-390434\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1-1200x174.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1-300x44.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1-250x36.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1-768x111.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_076-1.png 1371w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>This command is used\u00a0to update the <a href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/declarative-schema\/configuration\/\">Magento 2 database schema<\/a> and data, as well as apply any necessary system upgrades. <\/p>\n\n\n\n<p>It is used in the <a href=\"https:\/\/webkul.com\/blog\/upgrade-magento2-via-command-line\/\">Magento 2 upgrade<\/a> process and ensures that your Magento 2 store runs smoothly with the latest updates and features.<\/p>\n\n\n\n<p><strong>Run the command: php bin\/magento setup:di:compile<\/strong><\/p>\n\n\n\n<p>It is used to compile code like Factories, Proxies, Interceptors, etc., and puts them in the generated directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">php bin\/magento setup:di:compile<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"922\" height=\"119\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_077-1.png\" alt=\"Folder Structure\" class=\"wp-image-390435\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_077-1.png 922w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_077-1-300x39.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_077-1-250x32.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_077-1-768x99.png 768w\" sizes=\"(max-width: 922px) 100vw, 922px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p>Folder Structure till now<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"880\" height=\"162\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_126.png\" alt=\"Folder Structure\" class=\"wp-image-391500\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_126.png 880w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_126-300x55.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_126-250x46.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_126-768x141.png 768w\" sizes=\"(max-width: 880px) 100vw, 880px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Folder Structure<\/figcaption><\/figure>\n\n\n\n<p>Know more <a href=\"https:\/\/business.adobe.com\/in\/products\/magento\/magento-commerce.html\">about Magento 2<\/a>.<\/p>\n\n\n\n<p>Next blog -&gt; <a href=\"https:\/\/webkul.com\/blog\/magento-development-02-route-management-and-controllers\/\">Magento 2 Routing<\/a><\/p>\n\n\n\n<p>Previous blog -&gt; <a href=\"https:\/\/webkul.com\/blog\/magento-2-development-02-area-codes\/\">Magento 2 Area codes<\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a custom module in Magento 2 involves several structured steps to ensure that the module is properly defined, registered, and activated. In Magento 2 modules are a standalone unit where we write our functionalities or business logic to achieve our goal. It is a group of directories that contain the blocks, controllers, helpers, and <a href=\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":201,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[15551,2070],"class_list":["post-274741","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-llama3-1","tag-magento2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Module Registration in Magento 2<\/title>\n<meta name=\"description\" content=\"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Module Registration in Magento 2\" \/>\n<meta property=\"og:description\" content=\"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-01-27T14:09:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-12T11:59:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png\" \/>\n<meta name=\"author\" content=\"Sanjay Chouhan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sanjay Chouhan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\"},\"author\":{\"name\":\"Sanjay Chouhan\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462\"},\"headline\":\"Create Custom Module in Magento 2\",\"datePublished\":\"2021-01-27T14:09:51+00:00\",\"dateModified\":\"2025-03-12T11:59:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\"},\"wordCount\":459,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png\",\"keywords\":[\"llama3.1\",\"Magento2\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\",\"name\":\"Module Registration in Magento 2\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png\",\"datePublished\":\"2021-01-27T14:09:51+00:00\",\"dateModified\":\"2025-03-12T11:59:14+00:00\",\"description\":\"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123.png\",\"width\":1292,\"height\":267,\"caption\":\"Selection_123\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Custom Module in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462\",\"name\":\"Sanjay Chouhan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sanjay Chouhan\"},\"sameAs\":[\"https:\/\/www.instagram.com\/sanjaychouhansc\/\",\"https:\/\/in.linkedin.com\/in\/scchouhansanjay\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Module Registration in Magento 2","description":"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..","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:\/\/webkul.com\/blog\/module-registration-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"Module Registration in Magento 2","og_description":"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..","og_url":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2021-01-27T14:09:51+00:00","article_modified_time":"2025-03-12T11:59:14+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png","type":"","width":"","height":""}],"author":"Sanjay Chouhan","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sanjay Chouhan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/"},"author":{"name":"Sanjay Chouhan","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462"},"headline":"Create Custom Module in Magento 2","datePublished":"2021-01-27T14:09:51+00:00","dateModified":"2025-03-12T11:59:14+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/"},"wordCount":459,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png","keywords":["llama3.1","Magento2"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/module-registration-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/","url":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/","name":"Module Registration in Magento 2","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123-1200x248.png","datePublished":"2021-01-27T14:09:51+00:00","dateModified":"2025-03-12T11:59:14+00:00","description":"how to create custom module in Magento 2.. we have to create a registration.php file under the file path (app\/code\/Webkul\/BlogManager)..","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/module-registration-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/07\/Selection_123.png","width":1292,"height":267,"caption":"Selection_123"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/module-registration-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Custom Module in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/645580979f637b0e355deea21bd07462","name":"Sanjay Chouhan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cd6ee19f99bd1fcafef819135529c952d7c875d06fedd9fd4c4eb0996bafc1bd?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sanjay Chouhan"},"sameAs":["https:\/\/www.instagram.com\/sanjaychouhansc\/","https:\/\/in.linkedin.com\/in\/scchouhansanjay"],"url":"https:\/\/webkul.com\/blog\/author\/sanjay-chouhan180\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/274741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/201"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=274741"}],"version-history":[{"count":49,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/274741\/revisions"}],"predecessor-version":[{"id":486133,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/274741\/revisions\/486133"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=274741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=274741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=274741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}