How to post the source code in code in Wordpress

On WordPress, a shared environment is used by most sites, which can also be understood that they run on the same environment. Not only does it helps WordPress to save time updating millions of sites, but also it can reduce the time to fix bugs or offer new features to customers.

Although it’s advantageous for both WordPress and its users, running multiple sites on the same software can contain some hidden dangers. The entirety of WordPress can easily be taken down by one site if we are not careful enough. As a result, WordPress limits some of the things which you post on your site. After publishing the post, the code that you write or copy-and-paste from another site can be deleted automatically. It’s likely that the code is stripped down as a precaution for security purpose. You can contact Wordpress support team if the code is being stripped out improperly or you want to suggest more types of code that should be added. Also, the WordPress.com Business Planoffers the option to add any available code that you need.

In order to show you how to post the source code in code, here is an instructional writing for your needs.

How to post the source code in code

HTML Tags

In WordPress, only these following HTML code are allowed to add in your posts, pages, and widgets:

address, a, abbr, acronym, area, article, aside, b, big, blockquote, br, caption, cite, class, code, col, del, details, dd, div,dl, dt, em, figure, figcaption, footer, font, h1, h2, h3, h4, h5, h6, header, hgroup, hr, i, img, ins, kbd, li, map, mark, ol, p, pre, q, rp, rt, rtc, ruby, s, section, small, span, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

Some codes such as embed, frame, iframe, form, input, object, textarea which are well-known to people using HTML are not shown on the above list. To ensure security, WordPress does not allow those code on the Premium Plan and below.

JavaScript

Posting JavaScript is only available for users of the Business plan since it can be used for malicious purposes. An example of JavaScript being used for harmful purposes is that MySpace.com and LiveJournal have been taken offline by JavaScript in the past. Therefore, JavaScript will not be permitted as there are many dangers of using JavaScript.

When the post contains the JavaScript from trusted partners like YouTube and Google Video is saved, WordPress automatically convert it into a WordPress shortcode.

Flash and Other Embeds

In WordPress.com posts, pages, or text widgets, flash and other types of embed that use; frame, iframe, form, input, object, textarea are only permitted on the Business Plan.

In spite of the fact that there are some people with innocent intentions, WordPress remove the tags needed for these to work to ensure users’ security and avoid getting the site damaged. Instead of using flash and other types of embed, you can post Videos, Audio, and other items in many different ways. Also, there is a list of the various types of embeds which are allowed in Embedding content page.

Posting Source Code

In order to understand and know more about how to post source code on your blog, please check the Posting Source Code post.

Business Plan

In Business Plan, there will be no code limitations mentioned above. Additionally, you are provided with the option to install third-party plugins and themes. In order to keep your site and WordPress secured, your site will be separated from the shared WordPress.com environment when you install custom plugins and themes. There will also have some substantial infrastructure changes made behind the scenes for your site’s security. Due to these changes, you are allowed to add any code that you want anywhere on your site.

Please remember that although your site is separated from the shared environment, you need to be careful when inserting custom code. Since WordPress may still be vulnerable to attack, it’s recommended that you should add the code that comes from a reputable source.

Conclusion

Above is an instructional writing on how to post the source code in code with informative and detailed guidelines. We hope that you will take your time and read it carefully.