Escape HTML in WordPress

This sounds a little silly, but even as a developer I briefly got confused while trying to render (or rather, not render) HTML in WordPress.

I typically dump code into WordPress using their markdown syntax, which works great for almost everything.  But if you need to actually put HTML in a code block, that fails because it will literally get rendered into the page!

The solution is easy though.  Just google “HTML Entity Encoder” or something similar and you’ll get to a site like this https://mothereff.in/html-entities where you can enter your HTML and have it encoded so that it will display properly.

In case that doesn’t make sense to you, let’s use a div opening tag as an example.  It would change to &lt;div&gt; where the “lt” is less-than, or “<“, and the “rt” is greater-than, or “>”.  Since it’s encoded, it will be displayed properly, but the div tag will not be interpreted part of the page.

 

Set Up Google Search Console (Web Master Tools) on Word Press

You can now integrate your WordPress site into Google Search Console (Web Master Tools) very easily.

Just do this:

  1. Go to Google Search Console: https://search.google.com/search-console.
  2. If you haven’t set it up yet, it will have you add a property (website) to your account.
  3. To add a property, you just provide the URL of your site (the one users end up at, not the one you use to manage WordPress in the background).
  4. After this, you will be presented with multiple options for verifying the site.  One of them will be adding a meta tag.  Click that one and get the “content” string from the tag (the part between the quotes after “conent” =.
  5. Go to your WordPress site manager (the place you change things).  On the left bar, you can find “WP Admin”.  You can also probably just go to https://<your-site-name&gt;.wordpress.com/wp-admin/ directly.
  6. Click “Tools” then scroll down to “Google Webmaster Tools”, and add the content string there.
  7. Save.
  8. Go back to Google Search Console, refresh, and you should be able to see your website verified.  This might take a little while, but it was pretty instant for me.

Note that it can take a few days for Google to scan your website and build the necessary data to fully populate the UI and make it useful.