Title: Disable &#8220;paste&#8221; function in forminator Forms ?
Last modified: June 5, 2024

---

# Disable “paste” function in forminator Forms ?

 *  Resolved [selolascases](https://wordpress.org/support/users/selolascases/)
 * (@selolascases)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/)
 * Hello,
 * Firts of all I want to write how grateful I feel for this forminator plugin, 
   it meets my needs very well in almost all of its aspects. I would just want to
   disable the “paste” function in some parts of the forms I created and did not
   find how to do it, I come here to learn it if it is possible, if you please.
 * Thank you for reading me and have a nice day !
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdisable-paste-function-in-forminator-forms%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/#post-17806387)
 * Hi [@selolascases](https://wordpress.org/support/users/selolascases/),
 * Glad to know that you’re enjoying the plugin. Regarding the “paste” function,
   there isn’t any out-of-the-box feature, however, based on your form I suppose
   you are looking to prevent it for input fields and textarea for every form?
 * If yes, you can try this snippet:
 *     ```wp-block-code
       <?php
   
       add_action('wp_footer', function() {
   
       ?>
   
       <script>
       document.addEventListener("DOMContentLoaded", function() {
           // Select all input fields and textareas with Forminator classes
           var formElements = document.querySelectorAll('.forminator-input, .forminator-textarea');
   
           // Loop
           formElements.forEach(function(element) {
               element.addEventListener('paste', function(e) {
                   e.preventDefault();
                   alert('Paste operation is not allowed.');
               });
           });
       });
       </script>
   
   
       <?php
   
       });
       ```
   
 * The following line in the above code targets the input field and the textarea:
   `
   var formElements = document.querySelectorAll('.forminator-input, .forminator-
   textarea');`
 * If you only want to disable paste for the textarea then updating the following
   line as below should be good:
 * ` var formElements = document.querySelectorAll('.forminator-textarea')`;
 * You can implement the above code using mu-plugins. Please check this link on 
   how to implement the above code as a mu-plugins:
   [https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins](https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins)
 * Best Regards,
 * Nithin
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/#post-17825103)
 * Hi [@selolascases](https://wordpress.org/support/users/selolascases/),
 * Since we haven’t heard from you for a while. I’ll mark this thread as resolved
   for now. Please feel free to open a new thread if you have new queries.
 * Kind Regards
   Nithin
 *  Thread Starter [selolascases](https://wordpress.org/support/users/selolascases/)
 * (@selolascases)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/#post-18028666)
 * Hello,
 * thank you for your answer. I am sorry I did not reply earlier my “webrelated”
   activity had slowed down a lot and starts to regain a bit vitality now only.
 * I did as you proposed (at least I think) but up to now, it does not seem to work
   = paste is still allowed in text aeras. What did I do wrong, please ? [https://ibb.co/1Kv7B7T](https://ibb.co/1Kv7B7T)
 * I cannot find the mu-plugins folder among my plugins in my admin interface. I
   only found it browsing the file manager of my admin interface and the above screenshot
   comes from there.
 * Have a nice day
 *  Thread Starter [selolascases](https://wordpress.org/support/users/selolascases/)
 * (@selolascases)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/#post-18029166)
 * Hello again,
 * I found the solution myself : I forgot to save the file I created according to
   your snippet as a .php file ! It was a simple .txt file. Now that I changed the
   snippet extension from .txt to .php, it works just fine !
 * So sorry for opening this post again because of my distraction.
 * Have a nice day !

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Disable “paste” function in forminator Forms ?’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [selolascases](https://wordpress.org/support/users/selolascases/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/disable-paste-function-in-forminator-forms/#post-18029166)
 * Status: resolved