Title: HTML Validation fail &#8211; invalid duplicate element
Last modified: March 14, 2023

---

# HTML Validation fail – invalid duplicate element

 *  Resolved [wykananda](https://wordpress.org/support/users/wykananda/)
 * (@wykananda)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/html-validation-fail-invalid-duplicate-element/)
 * Hi there. Thanks for your great plugin!
 * One thing though…our page is failing html validation due to the presence of multiple
   <main> elements. Our main theme/content is the correct holder of the tag and 
   WPSearch seems to be the offender.
 * According to [https://www.w3schools.com/tags/tag_main.asp](https://www.w3schools.com/tags/tag_main.asp)
   and [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main),
   there should only be one use of the <main> tag in a document with the (generally
   frowned upon) exception that you can have more if the the “hidden” attribute 
   is set on any others. Additionally, according to the official docs, the <main
   > tag is specifically designated to represent the dominant content of the document
   which is, of course, not the case with WPSearch’s use.
 * Besides causing validation to fail, this incorrect duplicated <main> tag could
   also lead to hard to track down errors.
 * Can <main> simply be replaced with a <div>?
 * Kind regards.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhtml-validation-fail-invalid-duplicate-element%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Elio](https://wordpress.org/support/users/brelios/)
 * (@brelios)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/html-validation-fail-invalid-duplicate-element/#post-16566613)
 * Hi [@wykananda](https://wordpress.org/support/users/wykananda/),
 * thanks to bring this to our attention!
 * We will correct the template used by the plugin in the next update.
 * In the mean time you can customise the template and replace the <main> tag with
   a DIV as described in this guide: [https://searchwp.com/extensions/modal-form/#templates](https://searchwp.com/extensions/modal-form/#templates)
 * If you need any further help please let me know!
 *  Thread Starter [wykananda](https://wordpress.org/support/users/wykananda/)
 * (@wykananda)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/html-validation-fail-invalid-duplicate-element/#post-16567510)
 * Great, Elio. One thing… the default template linked to in the guide ([https://github.com/jchristopher/searchwp-modal-search-form/blob/master/templates/default.php](https://github.com/jchristopher/searchwp-modal-search-form/blob/master/templates/default.php))
   seems to be out of date and won’t respond to certain options in the WPSearch 
   configuration page. Instead, I copied the default.php from the plugin’s template
   directory to use as a starting point. You may want to consider updating github
   or the instructions to use this file.
 *  [Elio](https://wordpress.org/support/users/brelios/)
 * (@brelios)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/html-validation-fail-invalid-duplicate-element/#post-16577468)
 * Hi [@wykananda](https://wordpress.org/support/users/wykananda/),
 * Thanks for pointing that out!
   We have updated the link to the correct template
   code.

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

The topic ‘HTML Validation fail – invalid duplicate element’ is closed to new replies.

 * ![](https://ps.w.org/searchwp-modal-search-form/assets/icon-256x256.png?rev=2149619)
 * [SearchWP Modal Search Form](https://wordpress.org/plugins/searchwp-modal-search-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/searchwp-modal-search-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/searchwp-modal-search-form/)
 * [Active Topics](https://wordpress.org/support/plugin/searchwp-modal-search-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/searchwp-modal-search-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/searchwp-modal-search-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Elio](https://wordpress.org/support/users/brelios/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/html-validation-fail-invalid-duplicate-element/#post-16577468)
 * Status: resolved