I am using WordPress 3.4. with only the plugins that come with the wordpress default installation.
My problem is that I cannot add any links or html to my posts from the editor.
It seems that wordpress is filtering all code off and I can only add text.
I've also tried to embed code via the html tab but again the code just gets wiped out.
Any ideas of why this could be happening?
Adding HTML code in the HTML text-area should be fine alright, but it will strip some codes if it's not written in valid HTML. Can you paste the code you've been trying to add?
I hope I am correct in thinking that you mean switching between the visual and HTML editors. I ran into this as well, a few weeks ago, and after researching for over an hour it seems that this is just how the editor works.
Searching Google for " html stripped wordpress editor " will bring up results for this, going back to 2008.
My research led to me installing Preserved HTML Editor Markup and TinyMCE Advanced, to ensure that no html/code is stripped when saving a draft, or switching editor modes.
After installing the plugins, you will have to make one setting change for TinyMCE Advanced. In the admin area, navigate to 'Settings > TinyMCE Advanced'. Under Advanced Settings, check this setting.
Your HTML code should no longer be stripped when switching between the editors or saving a draft. If this isn't what you were referring to, sorry!
Plugins:
http://wordpress.org/extend/plugins/preserved-html-editor-markup
http://wordpress.org/extend/plugins/tinymce-advanced
(I would have used hyperlinks but I need 10 reputation to use more than two hyperlinks in a post.)
Related
I am having default theme (twenty sixteen) running over wp version 4.5.2. I've no plugins in active state (all deactivated). Having many pages created with long contents (about 500+ pages).
One of the page is having 18,997 words (http://surgemedia.staging.wpengine.com/6-mo-after-gastric-sleeve-warnings-successes). Please do not mind about the formatting since it is copied from live site to this staging site. When I try to edit content in this page in text mode, it is very very slow. I am not able to figure out what's the reason since the content does not have any images or external content.
Please help!
Thank you, Naresh
One thing that will drastically slow down the WP Editor on my computer is to have the Chrome inspector open at the same time. The inspector can be open on ANY Chrome window or tab and it will affect the WP editor in any of the others. Hopefully the word will get out and either the WP or Google team will fix it.
It might be a little late, but have you tried:
Checking your website speed (for example with: https://tools.pingdom.com/)
Checking your own network speed
Disabling browser add-ons / extentions
Disabling the browsers spelling checker in the text editor
Using multiple browsers to see if the problem persists
(In case all of the above doesn't work and you haven't encountered a problem like this before):
Prepare a clean installation of WordPress with a standard theme and copy paste your text into it, in case the current installation is corrupted. Try this on localhost before setting it live, in case the hosting-provider is the cause of the problem.
I have been documenting some C++ codes (or can be any codes) over the past few months on wordpress, with the Syntax-highlighter-evolved plugin. Everything had worked fine. e.g. the C++ codes displayed correctly in post. e.g. the following syntax would display C++ codes nicely in wordpress.
[code language="cpp"]
c++ codes goes here...
[/code]
Recently, I have started exploring using mark-down in wordpress and started writing mark-down in new posts with the wp-markdown plugin. (For the benefits of simplicity and ease of migration / sharing / maintenance in long term).
... And then ... I realized all of my older posts (with codes wraped in the Syntax-highligher-evolved syntax) have all got corrupted!
For example, characters (like < > etc), got converted into HTML entities (like < > etc). In addition, I also see LOADS of HTML tags being inserted into the C++ codes.
See here for a sample post on my wordpress site (scroll down to and you will see some code blocks.). It contains some supposingly C++ codes which now looks nothing like C++ codes.
Following discovering this error I have attempted playing around with activating and deactiving the plugins to see if I could get back to the working state (i.e. codes being displayed as C++ codes, instead of hybrid C++/HTML code). No luck so far.
(Currently I have both syntax-highlighter-evoled and wp-markdown plugins activated).
Has anyone encountered similar problems before and how did you resolve this?
Would be very grateful for all the help!
UPDATES (Monday 2nd March 2015):
As a workaround I have (1) disabled the wp-markdown plugin. (2) Kept the syntax-highlighter-evolved activated. (3) Activated the Jetpack markdown plugin. The manual workaround steps below helped me correct 1 (out of about 100) posts.
It looks like the Jetpack markdown plugin complement better with the syntax-highlighter-evolved plugin. (based on my observations so far.)
As an experiment, I have modified manually an old post by (1) turning the wordpress visual editor off. (2) edited that old post. Here are the new vs old.
when I started editing the old post, I noticed that the entire post was converted automatically to mark-down format in the editor (which is good). The good news was, the unexpected HTML tag now had gone away (I presume because I was using the bare minimum wordpress editor, instead of the visual editor). So at least I could recover / copy the entire chunk of markdown-like post to a text editor (like sublime text on my desktop).
This conversion was not perfect however - I noticed some by-products. such as...
lots of carriage return (i.e. new line) disappeared - causing multiple lines got "merged" into one line. I had to manually spot for these lines and re-format them one-by-one. (a pain!)
I noticed also things like #include appeared as # include (added space in the middle). So I had to manually correct those. Likewise for some other entities containing #.
To manually edit the old (now semi-markdown) post, I removed all the legacy syntax-highlighter open tag [code language="cpp"] to three back-tick plus the code extension (```.cpp). And the close tag [/code] to three back-tick (```). See the Jetpack Markdown Doc and Markdown Extra Doc for more info.
Once updated post with the new Jetpack markdown syntax, the syntax-highlighter-evolved seemed to "know" about these new tag and automatically apply c++ color coding to it. (if I use three back-tick without the code extension, the syntax-highlighter still work to wrap the code into a block, just without the color).
Net net. The good news is that I have found a workaround which will enable me to "upgrade" the post one-by-one, manually (and a way to recover old posts - i.e. no more unexpected HTML tags in code by disabling the wordpress visual editor). Downside: this will be a lengthy process as I will have to manually spot for the missing carriage-return and re-add them to the code block. Updating 100 posts like this will take... some time.
Update (7th March 2015)
Realized that the WP-plugin actually corrupt the original blog post files. So as a quick fix I manually edited the 100 posts using the editor, and replaced all the damaged code with the corrected version. Took me 3 days solid to do but at least corrected.
I noticed that the Jetpack Markdown Plugin and/or the Syntax Highliter Evolved are not perfected. e.g. even wraping a code with the opening and closing code tags, some bugs remained - such as backslashes got stripped, the less-than / greater than signs not displayed as expected, etc.
So I for creating new posts, I have tried out the (Github) Gist in conjunction with oEmbed Gist plugins (as suggested by #OllieJones below). Works beautifully so far (Gist seem to display codes as expected. Time will tell). I have this feeling that going forward I can use Gist to store all of my blog posts in markdown files, and simply use Wordpress to "display" these markdown files. (I wonder if Gist can be used to store the image files as well? Or I need to stick to Wordpress to store the image files?).
Here are some sample new blog posts using the Gist method. example1, example2.
The doggone markdown plugin translates posts from HTML to markdown when it loads them for editing, and translates them back when you Update them. I've had the same problem with code getting trashed. This is a big pain. (I fixed it with a backup.)
My solution is to use gists -- on http://gist.github.com/ -- to display my code. The oEmbed Gist plugin makes that work very well.
Sorry I am to late.
You can edit the "SyntaxHighlighter" plugin.
open "SyntaxHighlighter" plugin, edit it
wordpress will open syntaxhighlighter.php
search and romove all "htmlspecialchars" and "htmlspecialchars_decode" string.(maybe you need backup it)
save it
I used this fixed success.
My Englist is bad, but I tried my best, hope that may help for you
Expanding on Pea3nut answer, I had to modify the PHP file for SyntaxHighlighter Evolved so it ended like this
Go to Plugins -> Plugin file editor -> Select SyntaxHighlighter Evolved on the top right -> Copy the gist in the link above -> Select all and paste it there (replace it)
This also fixes the issue with Divi, so you don't have to pay for the Divi syntax highlighter code plugin and save $9 (it's free)
Im using Wordpress on my Webpages and now i have decided to post there some tutorials and posts about it, and i just need some button that can open a box with options and i need to make starting tag using these options, and after selected put the closing tag. Im not really good in JS so i understand only a bit.
I found this:
http://return-true.com/2011/12/adding-tinymce-button-to-wordpress-via-plugin-part-2/
Adding custom tag with TinyMCE using ed.selection.setContent
maybe i need only to combine these two solutions
This can be done using an own plugin. Your plugin needs a button and this button will trigger a tinymce command that you will have to define. This command will open the box.
Developing an own plugin is pretty easy: http://www.tinymce.com/wiki.php/Creating_a_plugin
You should get the tinymce development version from the moxiecode download page. Check out the plugins directory for a plugin that uses a popup/model dialog - i think something like the searchreplace plugin will help.
Can I hide the code of html + javascript of wordpress pages ?
I mean when anyone hits view source he/she will not able to know that the website was developed using WordPress ?
It is not possible to prevent a user from viewing the source of a website. The web browser needs to be able to render it, so any form of "encryption" would cause the browser to miss-render the page.
There are HTML obfuscation tools online such as this. But you would not be able to use them in WordPress as it generates all it's HTML on the fly.
Rather than hiding the fact that you are using WordPress I would suggest that you ensure your WP install is kept up-to date and that you use sensible security plugins such as Bulletproof Security.
If you simply want to remove the <meta name="generator" content="WordPress 3.4.1" /> tag from your generated HTML, you can add this in your theme's functions.php.
remove_action('wp_head', 'wp_generator');
If you want to remove the "Powered by WordPress" in the footer text, that'll depend the theme you're using. Some themes allow you to customize the footer text from the dashboard, others will need manual modifications in the footer.php.
It will probably still be obvious that you're using WordPress though. A lot of references to uploaded files inside wp-content will be visible and many class names will have the wp- prefix. You probably won't be able to change those without breaking your website.
In general, you can't stop users from viewing the source of your website. The HTML is what defines the markup and content of your website, and the browser simply renders it. The best you can do is obfuscate it in such way that you can't easily tell what each HTML element represents or what each JavaScript function does.
No it's not possible. It'll will always be possible to see it since the browser has to get it in plain text to render it.
Look at JavaScript obfuscation to make your code harder to reuse or understand : How can I obfuscate (protect) JavaScript?
I believe what you're trying to do is hide the fact that your site is powered by WordPress. For that, you can try the suggestions presented here:
How to Hide WordPress Info from Your Source Code
http://www.damianc.pl/wp-content/themes/damianc/cphp.png
I've blog based on WordPress, I use plug-in SyntaxHighlighter Evolved. In my posts first codes has empty space in Chrome, but in IE hasn't [image]. How fix it?
I don't think the issue is fixable.
I have run into FireFox/Chrome/IE formatting issues working as a Software Developer, and the issue was in the underlining HTML structure. Each browser would interpret the HTML code differently.
You might be able to fix the issue if you can change the HTML that is sent to your posts. If not, I would recommend getting a different code formater. WordPress has a built in format for code triggered by,
<code> your code here </code>
or
<tt> your code here </tt>
See link for more detail: Writing Code in Your Posts