This depends a lot on the context.
Normally, I would say that the form should be in a plugin.
The rule of thumbs is that if it’s a functionality that could still be needed when the theme is deactivated, then it should go into a plugin.
Now for your specific case, if using the customizer, would set options that could potentially break your form if the theme should be changed, then you should keep it in your theme’s functions.php
.
But, I would still argue that it should go into a plugin and you should make sure that, in the eventuality that the theme is changed, you set default values to the form to replace the customizer options.
Because chances are that even if the theme is changed, you’d still want the contact form to be active.
Related Posts:
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Is there any sort of theme dependency management?
- How to make plugin required in a wp theme without using php conditional statements when calling an individual function from that plugin?
- How do I cleanly override a plugin’s CSS with a child theme?
- Is it possible to stop selected plugins from loading on certain template pages?
- Can I make plugins required?
- Add Plugins to WordPress Theme
- Hide wordpress plugins from list
- wp_enqueue_scripts not working in custom theme
- What is the correct way for a theme to support plugin UIs?
- Automatically install wordpress plugin at theme activation
- When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- How to call “page specific menu items” in template [closed]
- Create WooCommerce Product Category Programmatically
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- WordPress tips for speed and performance [closed]
- How to access options of Redux framework in front end
- Update Multiple Post Meta for the Same Post In One call?
- Function to activate WordPress theme inside a plugin
- Integrating plugins in themes
- Seeking clarification on page request life-cycle
- Which functions in theme or plugin load first
- Change Jobs for WordPress templates
- Disqus comment system not show
- How to use plugin’s shortcode in custom design? [closed]
- WordPress panel is not loading after plugin activated with error: HTTP ERROR 500
- When the user entered an unauthorized url redirect to login page
- Remove action added in plugin class from theme
- How to wrap image tag into div for post only?
- Can you develop themes and plugins while using the hosting services BlueHost? [closed]
- Product catalogue in WordPress
- Add section (add_settings_section) to a custom page (add_submenu_page) not working
- Show content from plugin on index
- Help Code Review – I need to write on .htaccess file from theme’s function.php
- how to add custom css at top above all css file for specific url
- Where do the section input fields values are stored in database
- How can I add a custom checkbox / radio button on the admin theme options to display a CSS or other?
- Is it possible to restrict content in wordpress?
- Get plugin to background of page
- How to display the Facebook like count in WordPress theme [closed]
- How to increase script execution time at my server
- How to add wordpress plugins in along with my standalone theme
- Display Powerpress media url
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Convert HTML5/CSS3 site to WordPress Theme (need a lot of plugins) or just use the API?
- Showing ads in the specific category and its sub-categories
- twitter widget loads properly in all themes except my own theme?
- Plugin’s required JS not being inserted in my theme
- How to copy data from user profile page (profile.php) to theme customizer
- Directory structure for plugin changes
- How to show post attachment image
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- What is the Object for WP_Error Class?
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Disqus plugin outputs script as literal text
- Breadcrumb is not generating the correct post page url
- How can I add different menus (different style menu) on each page?
- Replace all media (images)
- Site is setup statically – how to make it content managable?
- How can I make a website with dynamic features with wordpress?
- How to generate a responsive output from plugin?
- How to work email subscribe in WordPress?
- WooCommerce custom query and paging: Not Found error
- How to create post comparison in wordpress
- Apostrophes replaced by '
- Open graph issue on my theme
- How to add image for custom taxonomy
- Javascript as Jquery Function Call?
- Integrating WordPress Content into a jQuery Slider
- Detect if you’re in the “Frontend Editor” mode in Visual Composer WordPress [closed]
- How can I convert a complete bootstrap template into a WordPress template? [closed]
- Editing a theme
- Can anyone tell some online tuts for plugin development for beginner? [closed]
- Custom GD Star Ratings Stars [closed]
- Email Masking in widget
- How to escape html code?
- Ajax button “Load more” is not loading correct language version posts for logged out users
- manage_{taxonomy}_custom_column not working
- How to code a wordpress page properly? Dashboard or unique Theme files or alternative?
- how to make wordpress remember my choice
- Is website for online game guides doable in WordPress? [closed]
- I want to include My theme file (testing.php) to inside my plugin folder (myplugin/mypugin.php)
- How to Enfroce Domain Licensing Limits? [closed]
- Override plugin constant using a theme
- Meta box not displaying on the plugin page
- add_meta_box showing blank screen in my page
- How to create an Info Box on WordPress [closed]
- How to make content as required in custom post type?
- What are Seeds? [closed]
- Getting error when accessing Customizer Page
- Best approach to change mobile background image and adding its class
- WordPress search every time shows no search found even data exists
- Frontend Enqueued Files in the Backend
- How to create new title and its description inside a section in WP Customizer?
- Composer dependency
- I want to move the one click accesbility button on bottom of my website screen,
- Automatically install bundled plugins during theme activation?
- How can I keep a WordPress dropdown menu open when navigating to a child page?
- Spectra styles not loading when crating theme from scratch with Create Block Theme plugin