Añadir más tags HTML en los comentarios de WordPress

Almacenar de forma segura los datos con etiquetas HTML en la base de datos

By default, WordPress allows certain HTML tags within the comments such as <a> <em> <strong> etc. If you notice a lot of SPAM comments also contain these tags. Most SPAM comments are made by bots and scripts, which are using HTML tags. If you simply disable HTML from your WordPress comments, it can prevent a lot of SPAM. In this tutorial we will show you how you can disable HTML tags in your WordPress comments.This tutorial will only disable active HTML tags. So someone can still post something like:&lt;a&gt;&lt;em&gt;&lt;strong&gt;And it will show up, but the tags will not be functional. So if someone uses the strong tag, it won’t bold the text. Besides not many SPAM bots have time to do this because this way takes up a lot of time and it is not beneficial for them.All you have to do is simply open your functions.php and add the following code:Tables can’t be imported directly. Please insert an image of your table which can be found here.

Cómo añadir HTML a WordPress para principiantes

In the HTML editor, everything is text — a link is text, a quote is text, even an image is text. But there are two kinds of text here. Some of the text is the actual content of the post you wrote, and some is the HTML code.

  Comentarios de Google+ en WordPress

It’s easy to tell the two apart: HTML code always starts and ends with angled brackets, < and >. Anything inside a pair of angled brackets is an HTML tag. Tags are predefined HTML commands that specify how your post will look and behave. Here’s an example:

To open a new tag, type the tag you want to use just before the text you wish to change in some way: <em>. When you want to end that effect, you insert a closing tag, which is the same tag but with a slash: </em>.

Image tags are used to embed images. While using the Media Library is the recommended way of inserting images into your posts, you can also use HTML. Here is an example of embedding an image using the <img> tag:

Cómo añadir comentarios al contenido de WordPress

Escenario: Estoy usando el plugin tinymcecomments para dar algunas capacidades de formato a los comentaristas. También oEmbed for Comments es bueno – cuando pones un enlace a youtube o vimeo automáticamente incrusta el video.

Abre este archivo en un editor de texto y localiza la lista de etiquetas HTML cerca de la parte superior del archivo. Cada etiqueta HTML está listada en una línea separada, en la construcción de un array PHP de etiquetas permitidas. Las líneas que comienzan con // están comentadas, o deshabilitadas, por lo que las líneas que comienzan con // designan etiquetas HTML que no están permitidas en los comentarios.

  Menciones de Twitter en los comentarios de WordPress

Para evitar que la gente publique HTML en los comentarios, edite su archivo kses.php como desee para permitir o no permitir etiquetas HTML específicas en los comentarios, añadiendo // al principio de las líneas apropiadas de la lista. Para excluir todas las etiquetas HTML, comente todas las líneas que permiten etiquetas HTML. Asegúrese de guardar el archivo cuando haya terminado.

Cómo eliminar etiquetas y atributos HTML fácilmente

Además, le mostraré cómo modificar la lista de etiquetas y atributos HTML permitidos para adaptarla a sus necesidades. Le mostraré cómo eliminar etiquetas de la lista predeterminada y cómo añadir etiquetas HTML a la lista para el área de texto Comentario en WordPress.

¿Sabes que los lectores pueden utilizar algunas etiquetas HTML en la sección de comentarios? ¿Específicamente en el área de texto del Comentario? Para facilitar las cosas a tus lectores, deberías notificarles qué etiquetas HTML pueden usar en el formulario de comentarios.

La función allowed_tags() está definida en wp-includes/general-template.php de su directorio WordPress. Esta función llama a la variable global $allowedtags definida en wp-includes/kses.php. La función allowed_tags() muestra todas las etiquetas HTML permitidas por defecto en WordPress con sus respectivos atributos.

  Muestra los comentarios como en Feedburner

En algunos temas, la función allowed_tags() está simplemente comentada. En este caso, todo lo que tiene que hacer es Descomentar esa línea de código, para mostrar qué etiquetas HTML están permitidas usar en el área de texto Comentario.

Si la siguiente línea de código (o algo similar) ya existe en el archivo comments.php de su tema, entonces todo lo que tiene que hacer es Descomentarla (lo que significa quitar <!– del principio de la línea Y –> del final de la Línea. Eso es TODO.