6.3.4.3. Quick Fixes Section
6.3.4.3.1. Remove links?
If you want to remove links from all of the short code data, check this. Checking this box is almost the same as adding the following rule for each find-replace option in this tab:
Regex: | Checked |
---|---|
Find: | <a\b[^>]*>((?:\n|.)*?)<\/a> |
Replace: | $1 |
For example, let’s say [wcc-main-content]
will be replaced with the following code:
This is a <a href="http://site.com/">link</a> that directs the user to a URL.
When this setting is checked, the short code will be replaced with the following code:
This is a link that directs the user to a URL.
All of the anchor tags, i.e. a
tags, will be removed without touching their contents. This
option will not touch custom links inside the templates. For example, let’s say you configured
Post Content Template as follows:
[wcc-main-content]
Click <a href="http://site.com/">here</a> to go to the target site.
In this case, the link you defined at the bottom of the template will not be removed. Only the
links inside the [wcc-main-content]
, and inside any other short code defined by the plugin, will be
removed.
6.3.4.3.2. Convert iframe elements to short code
WordPress does not allow iframe
elements for security reasons. If you want to show
iframe
s in the post template, you can check this. When you check this, the iframe
elements in the short code data will be converted to [wpcc-iframe]
short code that shows
iframe
s in the front end.
Important
Use this with caution since unknown iframe
s can cause security vulnerabilities. The short
code will output the HTML element only for the domains defined in
Allowed domains for iframe short code setting.
For more information, please refer to Short Codes Section.
6.3.4.3.3. Convert script elements to short code
WordPress does not allow script
elements for security reasons. If you want to show
script
s in the post template, you can check this. When you check this, script
elements
in the short code data will be converted to [wpcc-script]
short code that shows script
s
in the front end.
Important
Use this with caution since unknown script
s can cause security vulnerabilities. The short
code will output the HTML element only for the domains defined in
Allowed domains for script short code setting.
For more information, please refer to Short Codes Section.
6.3.4.3.4. Remove empty HTML elements and comments
Check this if HTML elements that do not have any content and comments in the HTML code should all
be removed from all parts of the post. This does not remove the elements that should not have
any content by default, such as img
elements.
For example, if this is checked, the following code
<!-- This is a comment -->
<div><p></p></div><p>This is an example.<br><img src="http://dummy.url"><a href="#"></a>
will be turned into the following:
<p>This is an example.<br><img src="http://dummy.url"></p>
6.3.4.3.5. Remove scripts
Check this if you want to remove scripts from all parts of the post. This removes script
elements as well as HTML attributes that can store JavaScript code, such as onclick
.
For example, if this is checked, the following code
<script type="text/javascript">var x = 3;</script>
<p onclick="showPopup()">This is an <a href="#" onmouseover="redirect()">example</a>.</p>
will be turned into the following:
<p>This is an <a href="#">example</a>.</p>