Title: Invalid Value
Last modified: November 25, 2023

---

# Invalid Value

 *  [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/)
 * Hi
 * When I analyze the page with PageSpeed ​​Insights, it shows an error in the comment
   inputs: [aria-*] attributes do not have valid values.
 * Here’s the reason: `….aria-required="'true'">`
 * There are nested quotes.

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

 *  [Muhammad Bux](https://wordpress.org/support/users/muhammadbux/)
 * (@muhammadbux)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17228770)
 * You only have three ARIA related attributes so let’s go through all three.
    1. tab is a valid role and the <button> element is allowed to have that role. (
       See the <button> spec – tab is the last one in the list.)
    2. aria-selected is only valid on certain types of objects, but tab is one of them
    3. aria-controls should contain an id, or list of ids. Your example looks like 
       it contains an id.
 * So check all three attributes.
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17228788)
 * [@muhammadbux](https://wordpress.org/support/users/muhammadbux/) thank you. But
   this defould WordPress commenst.
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17228887)
 * Sorry. I couldn’t explain it properly. Since I cannot see the aria-required statement
   in the X file, I think the problem is bigger.
 * ![](https://i0.wp.com/i.ibb.co/2hd3J5j/Ekran-g-r-nt-s-2023-11-25-152047.png?ssl
   =1)
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17228971)
 * The output of the HTML code for comments depends on the theme used and possibly
   also on plugins. Which theme are you using? Have you deactivated all plugins 
   as a test?
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229026)
 * This is not present in the comment file in core. It looks like it was added there
   later.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229037)
 * > Which theme are you using? Have you deactivated all plugins as a test?
 * Therefore, an answer or examination of my question would be helpful.
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229043)
 * > Which theme are you using? Have you deactivated all plugins as a test?
 * Mission News. No.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229066)
 * The theme is the reason. The output of this HTML attribute is incorrectly stored
   there.
 * **The specific reason:**
   [https://themes.trac.wordpress.org/browser/mission-news/1.56/inc/comments.php#L59](https://themes.trac.wordpress.org/browser/mission-news/1.56/inc/comments.php#L59)
   The attribute is declared here. In the output below in line 72, this attribute
   is masked with `esc_html()`, resulting in the incorrect output in the frontend.
 * **I see 3 possible solutions for you:**
 * a) You contact their support and ask them to adapt the programming: [https://wordpress.org/support/theme/mission-news/](https://wordpress.org/support/theme/mission-news/)
   
   b) You remove the output of the fields via the theme and use the WordPress standards
   again. To do this, you must store the following code in your child theme or via
   a [code snippet plugin](https://wordpress.org/plugins/code-snippets/):
 *     ```wp-block-code
       remove_filter( 'comment_form_default_fields', 'ct_mission_news_update_fields' );
       ```
   
 * c) You overlay the problematic function with the following customised programming
   using a child theme or [code snippet plugin](https://wordpress.org/plugins/code-snippets/):
 *     ```wp-block-code
       function ct_mission_news_update_fields( $fields ) {
   
           $commenter = wp_get_current_commenter();
           $req       = get_option( 'require_name_email' );
           $label     = $req ? '*' : ' ' . esc_html__( '(optional)', 'mission-news' );
           $aria_req  = $req ? 'true' : 'false';
   
           $fields['author'] =
               '<p class="comment-form-author">
       	            <label for="author">' . esc_html__( "Name", "mission-news" ) . esc_html( $label ) . '</label>
       	            <input id="author" name="author" type="text" placeholder="' . esc_attr__( "Jane Doe", "mission-news" ) . '" value="' . esc_attr( $commenter['comment_author'] ) .
               '" size="30"  aria-required="' . esc_attr( $aria_req ) . '" />
       	        </p>';
   
           $fields['email'] =
               '<p class="comment-form-email">
       	            <label for="email">' . esc_html__( "Email", "mission-news" ) . esc_html( $label ) . '</label>
       	            <input id="email" name="email" type="email" placeholder="' . esc_attr__( "name@email.com", "mission-news" ) . '" value="' . esc_attr( $commenter['comment_author_email'] ) .
               '" size="30" aria-required="' . esc_attr( $aria_req ) . '" />
       	        </p>';
   
           $fields['url'] =
               '<p class="comment-form-url">
       	            <label for="url">' . esc_html__( "Website", "mission-news" ) . '</label>
       	            <input id="url" name="url" type="url" placeholder="http://google.com" value="' . esc_attr( $commenter['comment_author_url'] ) .
               '" size="30" />
       	            </p>';
   
           return $fields;
       }
       ```
   
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229236)
 * Thank you [@threadi](https://wordpress.org/support/users/threadi/),
 * I will report it to the theme author. It was fixed when I removed the quotation
   mark in the place you showed me. Thanks all.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229453)
 * So did you customise the theme directly? I would advise against that. The change
   will be reverted with the next update.
 * If you consider the issue to be resolved, you are welcome to mark the topic as
   resolved.
 *  Thread Starter [Halil](https://wordpress.org/support/users/halilesen/)
 * (@halilesen)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17229799)
 * Yes. Many. But I’m using a child theme. Unfortunately it doesn’t work in inc/
   comments.php child theme.
 * I would be very pleased to receive your recommendations.
 *  Moderator [threadi](https://wordpress.org/support/users/threadi/)
 * (@threadi)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17230181)
 * I have already mentioned the possibilities above, including the source code. 
   If you already have a child theme, option c) would be sufficient.

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

The topic ‘Invalid Value’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 12 replies
 * 4 participants
 * Last reply from: [threadi](https://wordpress.org/support/users/threadi/)
 * Last activity: [2 years, 6 months ago](https://wordpress.org/support/topic/invalid-value-4/#post-17230181)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
