WordPress save options with html

On the administration page of my plugin, I have some options that the admin can customize.

I use this form and options are automatically saved :

Read More
<form method="post" action="options.php">

But if I enter some HTML code in a textarea, it works as well but WordPress adds some characters at the end of the options :

" />

There are present in the database and every time I retrieve the option.

How can prevent it as I don’t want to change options.php: all my changes need to stay in my plugin folder.

EDIT

Actual code :

<form method="post" action="options.php">
<?php settings_fields('bm-settings-group'); ?>
<table class="form-table">
    <tr valign="top">  
    <th scope="row">Liste des métiers : </th>  
    <td><textarea name="bm_metiers" style="width:300px;height:200px;">
    <?php echo get_option('bm_metiers'); ?>
    </textarea>
    </td>
    </tr>
 </table>

<p class="submit" align="right">
<input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />
</p>

Related posts

Leave a Reply

1 comment

  1. Can you post the actual form code? It looks like you’re getting the backend of an <input /> tag. Also note that <textarea> elements are formatted differently than <input />. For textareas you’ll want <textarea cols="" rows=""></textarea> not <input type="textarea" /> or <textarea />.