{"id":76575,"date":"2025-12-03T12:47:12","date_gmt":"2025-12-03T17:47:12","guid":{"rendered":"https:\/\/memberpress.com\/?post_type=ht_kb&#038;p=76575"},"modified":"2025-12-03T12:48:03","modified_gmt":"2025-12-03T17:48:03","slug":"auto-populate-coupon-codes-on-registration-forms","status":"publish","type":"ht_kb","link":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/","title":{"rendered":"Remplir automatiquement les codes de coupon dans les formulaires d'inscription"},"content":{"rendered":"\n<p>You can automatically apply a MemberPress coupon to all membership levels. This way, members don\u2019t have to find, copy, and paste coupons themselves. To do this, you can <strong><a href=\"#adding-the-code-snippet\" title=\"add a code snippet\">add a code snippet<\/a><\/strong> that will fill in coupon codes for them.<\/p>\n\n\n\n<p>This guide explains how to add the code snippet and adjust it to use your <a href=\"https:\/\/memberpress.com\/docs\/creating-a-coupon\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><strong>MemberPress Coupons<\/strong><\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"adding-the-code-snippet\"><a href=\"#adding-the-code-snippet\" title=\"Adding the Code Snippet\">Adding the Code Snippet<\/a><\/h2>\n\n\n\n<p>You can add the code snippet directly to your child-theme\u2019s functions.php file. However, it\u2019s recommended to add it via a code snippet plugin, such as <a href=\"https:\/\/wordpress.org\/plugins\/insert-headers-and-footers\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><strong>WPCode<\/strong><\/a>.<\/p>\n\n\n\n<p>Follow the steps below to install the WPCode plugin and add the code snippet:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Navigate to the <strong>Dashboard > Plugins > Add Plugin<\/strong>.<\/li>\n\n\n\n<li>Search for <strong>WPCode<\/strong> and locate the plugin.<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb11779d\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb11779d\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"680\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode.jpg\" alt=\"search for wpcode\" class=\"wp-image-76673\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-300x149.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-1024x510.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-768x382.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-342x170.jpg 342w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-840x418.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-1216x605.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-700x348.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Click the <strong>Install Now<\/strong> button.<\/li>\n\n\n\n<li>Click the <strong>Activate<\/strong> button.<\/li>\n\n\n\n<li>Head to <strong>Dashboard > Code Snippets > Add Snippet ><\/strong> <strong>Add Your Custom Code (New Snippet)<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb117bfb\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb117bfb\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet.jpg\" alt=\"new snippet in wpcode\" class=\"wp-image-76631\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-new-snippet-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Click the <strong>+ Add Custom Snippet <\/strong>button.<\/li>\n\n\n\n<li>Choose <strong>PHP Snippet<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb117f99\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb117f99\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet.jpg\" alt=\"select php snippet\" class=\"wp-image-76632\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-php-snippet-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"8\" class=\"wp-block-list\">\n<li>Add a title for the snippet and paste the following code in the <strong>Code Preview<\/strong> section.<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-background\" style=\"background-color:#f5f5f5\">\/\/ Auto-Populate MemberPress Registration Coupon Codes<br>function mepr_auto_populate_coupon() { <br>?><br><script><br>document.addEventListener('DOMContentLoaded', function() {<br><br>  \/\/ Wait for MemberPress scripts to initialize<br>  setTimeout(function() {<br><br>    var c = document.querySelector('.mepr_coupon input.mepr-coupon-code');<br>    if (c) {<br><br>      \/\/ Paste coupon below to replace '<strong>YOURCOUPON<\/strong>'<br>      c.value = '<strong>YOURCOUPON<\/strong>';<br><br>      \/\/ Trigger all relevant events for MemberPress<br>      ['input', 'keyup', 'change', 'blur'].forEach(function(evtName) {<br>        var evt = new Event(evtName, { bubbles: true });<br>        c.dispatchEvent(evt);<br>      });<br>    }<br><br>  }, 300);<br>});<br><\/script><br><?php <br>}<br>add_action( 'wp_head', 'mepr_auto_populate_coupon' );<br><\/pre>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb118343\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb118343\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save.jpg\" alt=\"add snippet and save\" class=\"wp-image-76635\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-add-code-save-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"9\" class=\"wp-block-list\">\n<li>Click the <strong>Save Snippet<\/strong> button.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"adjusting-and-activating-the-code-snippet\"><a href=\"#adjusting-and-activating-the-code-snippet\" title=\"Adjusting and Activating the Code Snippet\">Adjusting and Activating the Code Snippet<\/a><\/h3>\n\n\n\n<p>Follow these steps to adjust and activate the code snippet to auto-load the coupon code.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Navigate to <strong>Dashboard > MemberPress > Coupons.<\/strong><\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb118898\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb118898\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code.jpg\" alt=\"copy coupon code\" class=\"wp-image-76634\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-copy-code-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Copy the coupon code from the<strong> Code<\/strong> column. If you do not have a coupon, <strong><a href=\"https:\/\/memberpress.com\/docs\/creating-a-coupon\/\" target=\"_blank\" rel=\"noopener\" title=\"create a new one\">create a new one<\/a><\/strong>.<\/li>\n\n\n\n<li>Navigate to <strong>Dashboard > Code Snippets<\/strong>.<\/li>\n\n\n\n<li>Click on the code snippet that was added in the <strong><a href=\"#adding-the-code-snippet\" title=\"previous section\">previous section<\/a><\/strong>.<\/li>\n\n\n\n<li>Replace <strong>YOURCOUPON<\/strong> in the code snippet with the code you wish to use on the following line of code. Here is an example of how to replace \u201c<strong>YOURCOUPON<\/strong>\u201d with \u201c<strong>DISCOUNT10<\/strong>.\u201d<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-background\" style=\"background-color:#f5f5f5\">\/\/ Paste coupon below to replace '<strong>YOURCOUPON<\/strong>'<br>      c.value = '<strong>DISCOUNT10<\/strong>';<\/pre>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb118cf1\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb118cf1\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code.jpg\" alt=\"replace coupon in snippet\" class=\"wp-image-76636\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-replace-code-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Activate the snippet.<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb119021\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb119021\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update.jpg\" alt=\"activate and update snippet\" class=\"wp-image-76637\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-activate-update-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<ol start=\"7\" class=\"wp-block-list\">\n<li>Click the <strong>Update<\/strong> button.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"testing-the-coupon-codes-during-registration\"><a href=\"#testing-the-coupon-codes-during-registration\" title=\"Testing the Coupon Codes During Registration\">Testing the Coupon Codes During Registration<\/a><\/h2>\n\n\n\n<p>The coupon code added in the code snippet should automatically populate on registration forms. To test it, follow the steps below.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open any membership from <strong>Dashboard > MemberPress > Memberships<\/strong> in an <strong>Incognito (private) Window<\/strong> in your browser.<\/li>\n\n\n\n<li>Review the invoice amount and total amount to ensure the coupon is applied automatically.<\/li>\n<\/ol>\n\n\n\n<figure data-wp-context=\"{\"imageId\":\"69d60fb119538\"}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d60fb119538\" class=\"wp-block-image size-full wp-lightbox-container\"><img decoding=\"async\" width=\"1366\" height=\"681\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview.jpg\" alt=\"coupon on registration form\" class=\"wp-image-76638\" srcset=\"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview.jpg 1366w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-300x150.jpg 300w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-1024x511.jpg 1024w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-768x383.jpg 768w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-50x25.jpg 50w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-341x170.jpg 341w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-840x419.jpg 840w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-1216x606.jpg 1216w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-700x349.jpg 700w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-156x78.jpg 156w, https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-discount-preview-1080x538.jpg 1080w\" sizes=\"(max-width: 1366px) 100vw, 1366px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Agrandir\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"applying-coupon-codes-automatically-on-registration\"><a href=\"#applying-coupon-codes-automatically-on-registration\" title=\"Applying Coupon Codes Automatically on Registration\">Applying Coupon Codes Automatically on Registration<\/a><\/h3>\n\n\n\n<p>The code snippet automatically applies a single coupon code to all membership levels on the site. This makes signing up easier by eliminating the need for users to manually enter the code.<\/p>\n\n\n\n<p>By default, the coupon field is hidden in MemberPress registration forms. Users see a \u201c<strong>Have a discount code<\/strong>\u201d link; clicking it displays an input field for the coupon code. You can add a code snippet to <a href=\"https:\/\/library.wpcode.com\/snippet\/joervjj5\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><strong>auto-expand the coupon field<\/strong><\/a> on all MemberPress registration forms. This ensures users see the field without clicking a link.<\/p>\n\n\n\n<p>For specific campaigns or membership tiers, site administrators can <a href=\"https:\/\/memberpress.com\/docs\/enabling-coupons-upon-registration\/#apply-coupons-url\" target=\"_blank\" rel=\"noopener\" title=\"\"><strong>apply different coupons using a URL parameter<\/strong><\/a>. This means users can have different coupons automatically applied based on the link they click to register.<\/p>\n\n\n\n<p>Additionally, <a href=\"https:\/\/memberpress.com\/docs\/wpcode-conditional-logic-for-memberpress\/\" target=\"_blank\" rel=\"noopener\" title=\"\"><strong>WPCode allows conditional logic<\/strong><\/a> to control when and for whom the coupon code is applied. You can set conditions to ensure the coupon applies only to logged-in users or to those with a specific membership.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apprenez \u00e0 remplir automatiquement les codes de coupon MemberPress sur les formulaires d'inscription \u00e0 l'aide d'un simple extrait de code avec WPCode. \u00c9liminez la saisie manuelle pour les membres.<\/p>","protected":false},"author":86440,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","_FSMCFIC_featured_image_caption":"","_FSMCFIC_featured_image_nocaption":"","_FSMCFIC_featured_image_hide":"","_strive_checklists":"\"\"","_strive_active_checklist":"62291e2bb2422","footnotes":""},"ht-kb-category":[1320],"ht-kb-tag":[],"class_list":{"0":"post-76575","1":"ht_kb","2":"type-ht_kb","3":"status-publish","4":"format-standard","6":"ht_kb_category-coupons","7":"entry","8":"has-post-thumbnail"},"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO Pro 4.9.5.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kashif\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 4.9.5.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"fr_FR\" \/>\n\t\t<meta property=\"og:site_name\" content=\"MemberPress\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Auto-Populate Coupon Codes on Registration Forms\" \/>\n\t\t<meta property=\"og:description\" content=\"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1650\" \/>\n\t\t<meta property=\"og:image:height\" content=\"1275\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-12-03T17:47:12+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-12-03T17:48:03+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/memberpress\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@memberpress\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Auto-Populate Coupon Codes on Registration Forms\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#article\",\"name\":\"Auto-Populate Coupon Codes on Registration Forms\",\"headline\":\"Auto-Populate Coupon Codes on Registration Forms\",\"author\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/blog\\\/author\\\/kashifcaseproof-com\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2025\\\/12\\\/mepr-1-12-10-search-for-wpcode.jpg\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#articleImage\",\"width\":1366,\"height\":680},\"datePublished\":\"2025-12-03T12:47:12-05:00\",\"dateModified\":\"2025-12-03T12:48:03-05:00\",\"inLanguage\":\"fr-FR\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#webpage\"},\"articleSection\":\"Coupons\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/memberpress.com\\\/fr\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/general\\\/#listItem\",\"name\":\"General\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/general\\\/#listItem\",\"position\":2,\"name\":\"General\",\"item\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/general\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/registration-and-payments\\\/#listItem\",\"name\":\"Registration and Payments\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/registration-and-payments\\\/#listItem\",\"position\":3,\"name\":\"Registration and Payments\",\"item\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/registration-and-payments\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/coupons\\\/#listItem\",\"name\":\"Coupons\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/general\\\/#listItem\",\"name\":\"General\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/coupons\\\/#listItem\",\"position\":4,\"name\":\"Coupons\",\"item\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/coupons\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#listItem\",\"name\":\"Auto-Populate Coupon Codes on Registration Forms\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/registration-and-payments\\\/#listItem\",\"name\":\"Registration and Payments\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#listItem\",\"position\":5,\"name\":\"Auto-Populate Coupon Codes on Registration Forms\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/doc-categories\\\/coupons\\\/#listItem\",\"name\":\"Coupons\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/#organization\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"url\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/mp-icon-RGB_Icon-01.jpg\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#organizationLogo\",\"width\":1650,\"height\":1275,\"caption\":\"memberpress logo icon\"},\"image\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.instagram.com\\\/memberpress\\\/\",\"https:\\\/\\\/www.pinterest.com\\\/memberpressplugin\\\/\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/MemberPressPlugin\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/memberpress\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/blog\\\/author\\\/kashifcaseproof-com\\\/#author\",\"url\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/blog\\\/author\\\/kashifcaseproof-com\\\/\",\"name\":\"Kashif\",\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/memberpress.com\\\/wp-content\\\/litespeed\\\/avatar\\\/2fa3d3f90ddc6213dce27b98165e7ec9.jpg?ver=1775158903\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#webpage\",\"url\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/\",\"name\":\"Auto-Populate Coupon Codes on Registration Forms\",\"description\":\"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.\",\"inLanguage\":\"fr-FR\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/docs\\\/auto-populate-coupon-codes-on-registration-forms\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/blog\\\/author\\\/kashifcaseproof-com\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/blog\\\/author\\\/kashifcaseproof-com\\\/#author\"},\"datePublished\":\"2025-12-03T12:47:12-05:00\",\"dateModified\":\"2025-12-03T12:48:03-05:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/#website\",\"url\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/\",\"name\":\"MemberPress\",\"description\":\"The All-In-One WordPress Membership Plugin\",\"inLanguage\":\"fr-FR\",\"publisher\":{\"@id\":\"https:\\\/\\\/memberpress.com\\\/fr\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>Auto-Populate Coupon Codes on Registration Forms<\/title>\n\n","aioseo_head_json":{"title":"Remplir automatiquement les codes de coupon dans les formulaires d'inscription","description":"Apprenez \u00e0 remplir automatiquement les codes de coupon MemberPress sur les formulaires d'inscription \u00e0 l'aide d'un simple extrait de code avec WPCode. \u00c9liminez la saisie manuelle pour les membres.","canonical_url":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#article","name":"Auto-Populate Coupon Codes on Registration Forms","headline":"Auto-Populate Coupon Codes on Registration Forms","author":{"@id":"https:\/\/memberpress.com\/fr\/blog\/author\/kashifcaseproof-com\/#author"},"publisher":{"@id":"https:\/\/memberpress.com\/fr\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2025\/12\/mepr-1-12-10-search-for-wpcode.jpg","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#articleImage","width":1366,"height":680},"datePublished":"2025-12-03T12:47:12-05:00","dateModified":"2025-12-03T12:48:03-05:00","inLanguage":"fr-FR","mainEntityOfPage":{"@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#webpage"},"isPartOf":{"@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#webpage"},"articleSection":"Coupons"},{"@type":"BreadcrumbList","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr#listItem","position":1,"name":"Home","item":"https:\/\/memberpress.com\/fr","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/general\/#listItem","name":"General"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/general\/#listItem","position":2,"name":"General","item":"https:\/\/memberpress.com\/fr\/doc-categories\/general\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/#listItem","name":"Registration and Payments"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/#listItem","position":3,"name":"Registration and Payments","item":"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/#listItem","name":"Coupons"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/general\/#listItem","name":"General"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/#listItem","position":4,"name":"Coupons","item":"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/","nextItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#listItem","name":"Auto-Populate Coupon Codes on Registration Forms"},"previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/#listItem","name":"Registration and Payments"}},{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#listItem","position":5,"name":"Auto-Populate Coupon Codes on Registration Forms","previousItem":{"@type":"ListItem","@id":"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/#listItem","name":"Coupons"}}]},{"@type":"Organization","@id":"https:\/\/memberpress.com\/fr\/#organization","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","url":"https:\/\/memberpress.com\/fr\/","logo":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#organizationLogo","width":1650,"height":1275,"caption":"memberpress logo icon"},"image":{"@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#organizationLogo"},"sameAs":["https:\/\/www.instagram.com\/memberpress\/","https:\/\/www.pinterest.com\/memberpressplugin\/","https:\/\/www.youtube.com\/c\/MemberPressPlugin","https:\/\/www.linkedin.com\/company\/memberpress\/"]},{"@type":"Person","@id":"https:\/\/memberpress.com\/fr\/blog\/author\/kashifcaseproof-com\/#author","url":"https:\/\/memberpress.com\/fr\/blog\/author\/kashifcaseproof-com\/","name":"Kashif","image":{"@type":"ImageObject","url":"https:\/\/memberpress.com\/wp-content\/litespeed\/avatar\/2fa3d3f90ddc6213dce27b98165e7ec9.jpg?ver=1775158903"}},{"@type":"WebPage","@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#webpage","url":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/","name":"Auto-Populate Coupon Codes on Registration Forms","description":"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.","inLanguage":"fr-FR","isPartOf":{"@id":"https:\/\/memberpress.com\/fr\/#website"},"breadcrumb":{"@id":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/#breadcrumblist"},"author":{"@id":"https:\/\/memberpress.com\/fr\/blog\/author\/kashifcaseproof-com\/#author"},"creator":{"@id":"https:\/\/memberpress.com\/fr\/blog\/author\/kashifcaseproof-com\/#author"},"datePublished":"2025-12-03T12:47:12-05:00","dateModified":"2025-12-03T12:48:03-05:00"},{"@type":"WebSite","@id":"https:\/\/memberpress.com\/fr\/#website","url":"https:\/\/memberpress.com\/fr\/","name":"MemberPress","description":"The All-In-One WordPress Membership Plugin","inLanguage":"fr-FR","publisher":{"@id":"https:\/\/memberpress.com\/fr\/#organization"}}]},"og:locale":"fr_FR","og:site_name":"MemberPress","og:type":"article","og:title":"Auto-Populate Coupon Codes on Registration Forms","og:description":"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.","og:url":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/","og:image":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","og:image:secure_url":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg","og:image:width":1650,"og:image:height":1275,"article:published_time":"2025-12-03T17:47:12+00:00","article:modified_time":"2025-12-03T17:48:03+00:00","article:publisher":"https:\/\/www.facebook.com\/memberpress\/","twitter:card":"summary_large_image","twitter:site":"@memberpress","twitter:title":"Auto-Populate Coupon Codes on Registration Forms","twitter:description":"Learn how to auto-populate MemberPress Coupon Codes on registration forms using a simple code snippet with WPCode. Eliminate manual entry for members.","twitter:image":"https:\/\/memberpress.com\/wp-content\/uploads\/2022\/10\/mp-icon-RGB_Icon-01.jpg"},"aioseo_meta_data":{"post_id":"76575","title":"#post_title","description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"Coupon Codes","score":91,"analysis":{"keyphraseInTitle":{"score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"score":9,"maxScore":9,"error":0},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":2},"keyphraseInURL":{"score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"score":9,"maxScore":9,"error":0},"keyphraseInSubHeadings":{"score":9,"maxScore":9,"error":0},"keyphraseInImageAlt":{"score":3,"maxScore":9,"error":1},"keywordDensity":{"type":"best","score":9,"maxScore":9,"error":0}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":"#post_title","og_description":"#post_excerpt","og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":"#post_title","twitter_description":"#post_excerpt","schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"seo_analyzer_scan_date":"2025-12-03 17:59:15","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":"0","open_ai":null,"ai":{"faqs":[],"keyPoints":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2025-11-28 15:46:06","updated":"2026-03-03 14:49:46"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/fr\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/fr\/doc-categories\/general\/\" title=\"General\">General<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/\" title=\"Registration and Payments\">Registration and Payments<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/\" title=\"Coupons\">Coupons<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\tAuto-Populate Coupon Codes on Registration Forms\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/memberpress.com\/fr"},{"label":"General","link":"https:\/\/memberpress.com\/fr\/doc-categories\/general\/"},{"label":"Registration and Payments","link":"https:\/\/memberpress.com\/fr\/doc-categories\/registration-and-payments\/"},{"label":"Coupons","link":"https:\/\/memberpress.com\/fr\/doc-categories\/coupons\/"},{"label":"Auto-Populate Coupon Codes on Registration Forms","link":"https:\/\/memberpress.com\/fr\/docs\/auto-populate-coupon-codes-on-registration-forms\/"}],"_links":{"self":[{"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb\/76575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/users\/86440"}],"replies":[{"embeddable":true,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/comments?post=76575"}],"version-history":[{"count":26,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb\/76575\/revisions"}],"predecessor-version":[{"id":79005,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb\/76575\/revisions\/79005"}],"wp:attachment":[{"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/media?parent=76575"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb-category?post=76575"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/memberpress.com\/fr\/wp-json\/wp\/v2\/ht-kb-tag?post=76575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}