Every time i create new post id="WRWHOISInstalled" is in the html wordpress editor

Everytime i create a new post there is a code in the editor when i view it in html mode i see this code; <div id="WRWHOISInstalled" style="display: none;"></div> there wasnt this problem before it happend automaticly by itself? i tried searching it on the internet but i didint find anything please help :( Note im using classic editor
Category: Web

Adding a Media Button to the WordPress Content Editor

So i'm trying to add a button over the text editor which on pressed lets the user paste in a youtube link which is then covered in shortcode something like this [code]youtube.com[/code]. Following this guide lets me show the button however pressing the button does northing. nothing afterwards pops up. See screenshots for clarification. And here's my code: jQuery(function($) { $(document).ready(function(){ $('#insert-my-media').click(open_media_window); }); function open_media_window() { if (this.window === undefined) { this.window = wp.media({ title: 'Insert a media', library: {type: …
Category: Web

Disable TinyMCE Table formatting width/height

Hi there I want to disable automatic formatting of table/td/tr widths and heights in WordPress TinyMCE. I create the table, literally type the data in (not copying it from word or anything like that) and it adds in width and heights to my table cells. Then I copy the code into a text editor and remove the widths and heights, then paste it back in and it adds the widths and heights again. Its giving me a headache. The table …
Category: Web

How to make Wordpress and TinyMCE accept <a> tags wrapping block-level elements as allowed in HTML5?

Starting with version 5 the HTML standard allows &lt;a&gt; tags wrap block-level elements. On a specific page I need to wrap a heading and an image with an &lt;a&gt; tag: Some intro text. &lt;div&gt; &lt;a href="http://somewhere/"&gt; &lt;h4&gt;Some heading&lt;/h4&gt; &lt;img src="http://somewhere/some-img.jpg" alt="Some image" /&gt; &lt;/a&gt; &lt;/div&gt; While I can enter this in the text editor it causes some strange behavior: The code above will be transformed into this HTML code: &lt;p&gt;Some intro text.&lt;/p&gt; &lt;div&gt; &lt;a href="http://somewhere/"&gt;&lt;/p&gt; &lt;h4&gt;Some heading&lt;/h4&gt; &lt;p&gt;&lt;img src="http://somewhere/some-img.jpg" alt="Some …
Category: Web

How to add custom HTML tags in the visual mode via keyboard only?

Let say I want to insert different inline formatting texts. I can do that by opening the HTML mode, but is there a way to do it directly in the visual mode? For example, if I type span.a in a paragraph block then it will insert &lt;span class=&quot;a&quot;&gt;&lt;/span&gt; in HTML, similarly how the formatting buttons like bold or italic do. Or perhaps at least a hotkey button to apply custom formatting, like Ctrl+B. Is that possible? Or to take it …
Category: Web

Why does the custom HTML block not preserve the HTML characters?

For example it seems that the plain single-quote character ' (&amp;#x27;) is converted to the right ones ’ (&amp;#8217;) in the HTML page output. I understand the reason for this in regular Gutenberg blocks, but why does it still need to be done in the custom HTML block? I enable troubleshooting mode and use the Twenty Twenty-One theme and it's still converting. Here are the different between the input methods: &lt;p&gt;Paragraph block then converted to html: &amp;#8216;&lt;/p&gt; Custom HTML block: …
Category: Web

Text Editor Tags

Hello Wordpress StackExchange, I'm embarrassed by what is probably a rookie question, but here it is: I migrated and took over a website that a friend hired another developer to create, but I don't recognize these tags (main, article, equalizewrapper). My question is, are they built into WordPress, or maybe are part of a customized theme? I couldn't find any information in my Google searches for equalizewrapper. Thanks in advance. Sample code below: [main] [article] [equalizewrapper class=&quot;row full&quot;] [equalize class=&quot;large-8 …
Category: Web

How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor

I followed this tutorial which is adding a custom button into Visual Editor as it is supposed to. But this is not adding the button into the Text(HTML) Editor. Can you please let me know how I can add my own button into Text(HTML) Editor only (or at least both! and not Visual one) function enqueue_plugin_scripts($plugin_array) { //enqueue TinyMCE plugin script with its ID. $plugin_array[&quot;green_button_plugin&quot;] = plugin_dir_url(__FILE__) . &quot;index.js&quot;; return $plugin_array; } add_filter(&quot;mce_external_plugins&quot;, &quot;enqueue_plugin_scripts&quot;); function register_buttons_editor($buttons) { //register buttons with …
Category: Web

Stop removing whitespace when I hit "Update"?

I want to store my posts in plaintext markdown instead of HTML. I have started by following Store post in raw markdown format, no html?, and as a result I do get what seems like a plain text box as my editor. However, when I hit update, the spaces that I indent code blocks with are being removed (as described here). (UPD. This actually happens on blur from the text box; it just normally coincides with a click on the …
Category: Web

Stop WordPress From Removing HTML Comments In Content

Whenever I switch from the visual editor to the text (HTML) editor and put an HTML comment in the code, e.g. &lt;!-- this is a comment--&gt;, WordPress removes it, either after saving the change or switching back and forth between editing modes. Is this a quirk of WordPress or TinyMCE and more importantly, how do I stop this so I can keep the comments in the content?
Category: Web

serialize_blocks breaking html tags in content

I'm trying to inject some data into blocks via PHP but am running into trouble with parse_blocks/serialize_blocks breaking my content I'm using the default 2020 theme and have no plugins installed add_action('wp', function() { $oPost = get_post(119); printf(&quot;&lt;h1&gt;Post Content&lt;/h1&gt;&lt;p&gt;%s&lt;/p&gt;&quot;, var_dump($oPost-&gt;post_content)); $aBlocks = parse_blocks($oPost-&gt;post_content); printf(&quot;&lt;h1&gt;Parsed Blocks&lt;/h1&gt;&lt;pre&gt;%s&lt;/pre&gt;&quot;, print_r($aBlocks, true)); $sSerialisedBlocks = serialize_blocks($aBlocks); printf(&quot;&lt;h1&gt;Serialised Blocks&lt;/h1&gt;&lt;p&gt;%s&lt;/p&gt;&quot;, var_dump($sSerialisedBlocks)); }, PHP_INT_MAX); The first print (just outputting the post content) contains this text... &lt;h3&gt;What types of accommodation are available in xxxx?&lt;\/h3&gt; The second (after parsing into blocks) …
Category: Web

Wordpress editor not creating <p></p> tags properly in tables

Wordpress isn't creating paragraph tags properly for paragraphs in a table. For example, the following in the Wordpress text editor: &lt;table style="border-collapse: collapse; width: 100%;"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style="width: 100%;"&gt;a b c&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; a b c Results in this HTML: &lt;table style="border-collapse: collapse; width: 100%;"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style="width: 100%;"&gt;a&lt;/p&gt; &lt;p&gt;b&lt;/p&gt; &lt;p&gt;c&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;a&lt;/p&gt; &lt;p&gt;b&lt;/p&gt; &lt;p&gt;c&lt;/p&gt; There are HTML errors in the table with the paragraph p tags, but outside the table isn't fine. Why is …
Category: Web

Block editor: content resets to the previous state in "Edit as HTML" by clicking somewhere outside of the editing window

When I'm adding my custom block and then trying to edit it in "Edit as HTML" mode, any changes reset to the previous state every time when I click outside the editing window. Let say default HTML in my block is &lt;div class="wp-block-my-custom-video-box"&gt;&lt;/div&gt;, if I make some changes, let say &lt;div class="wp-block-my-custom-video-box"&gt;some text&lt;/div&gt; some text will disappear. This issue related to WordPress ver. 5.3.2, with ver. 5.2.5 everything works fine. Help me figure out, please, what can cause such strange …
Category: Web

Product Custom Fields with HTML and JS

I have a custom textarea filed for the product page. woocommerce_wp_textarea_input( array( 'id' =&gt; '_custom_product_calc', 'label' =&gt; __('Test', 'woocommerce') ) ); $woocommerce_custom_product_calc = $_POST['_custom_product_calc']; if (!empty($woocommerce_custom_product_calc)) update_post_meta($post_id, '_custom_product_calc', esc_html($woocommerce_custom_product_calc)); I need to use this field for insert some HTML code with JS. But, as you can see, the result is not what I've expected. How can I change this? Or, maybe you know a better way to add a tab with HTML and JS for a product page? Clone Short …
Category: Web

Disable the Code View in the content editor?

Is there a way to disable JUST the Code editor view in the content editor? I have a bunch of clients who fancy themselves developers and keep messing up their own pages because they really have no idea what they're doing. They manage their own content so I can't shut down their editing capabilities entirely, but that's all I can find functions for (that and Google is still overrun with articles about disabling Gutenberg every time you use "WordPress" and …
Category: Web

Can `<style>` and `<script>` tags be used in the HTML editor?

I understand this is so stupid, because absolutely there should be an answer out there, but I can't find it myself. In short, can you use &lt;style&gt; and &lt;script&gt; tags in the HTML editor, without any plugin or touching the style.css file? I am an author of a blog I don't own, and I would like to add custom styles on my articles. I try it and it seems that it doesn't work, but I would like to have a …
Category: Web

how can default_content filter tell if content will load in block editor or classic editor?

In short, I want to use the default_content filter to return slightly different content depending on if it will be used in the block editor or not (eg. the quicktags or tinymce editor) - is there any way I can tell from the default_content filter how the content will be used? Lengthy version: I created a simple author signature (simple text field added via acf) that adds a signature to the bottom of a user's posts/comments via the default_content filter …
Category: Web

Removing line breaks when in text view with wp_editor

While working on a custom plugin, I needed to add the wp_editor in the admin to let the user add its own content. I want the user to be able to write custom rich texts with the "Visual" editor mode but I also want the user to be able to paste HTML codes in the "Text" view. For example, if he wants to paste his subscription HTML form, he could do that while switching to the "Text" mode. The issue …
Category: Web

Visual editor keeps stripping my <a> tags

My first post, please forgive me if I'm doing it wrong. For some reason when switching to the visual editor WordPress will strip out my a tags. "Don't use the visual editor" isn't an option, I'm making a website for clients and I'm trying to make it foolproof. I don't want them to be able to go to the visual editor and accidentally have all the links stripped out. This is a sample of the code. When switching to visual …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.