How do I hide WordPress from my source code? - wordpress

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

Related

What will happen to my content if i switch from elementor to simple editor?

Want to switch my elementor builder interface in simple editor like old Html one on my website tellthebell* as my site load's slowly due to this builder. want to know if my content will be loss or just the design will change?
Or suggest something that might help my loading time of site.
Yes agreed with the #cengiz sevimli Not only design will be lost also the content can be deleted. However if you have added any posts it will be saved at backend and you can add it up again from there in the new design.
well, a simple and easiest trick to do is save your content (Manually save in word doc) by pressing ctrl+A then switch to the old mode of HTML, if you lose your design/ interface..try editing or adding content that you already saved...Also, you can change your theme and again use the same content, etc.. it works very well you just need to be little tricky :P
Frist, you need to perform speed optimization for your website. It will help to load your website as soon as possible.
You can use Autoptimize and WP Rocket Plugin to boost the speed of your website.
Second, if you will switch your website from elementor to another builder you will lose complete design. After that, you need to redesign your website.
For check the speed of your website use : https://gtmetrix.com
If you change your builder, you may end up losing your designs. However you can try backing up your builder's raw code by pressing "Use Default Editor" like:

TinyMCE on WordPress misbehaves on client's computer

I have a client who's having trouble with Visual Editor on WordPress but I cannot, for the life of me, replicate the issue my client's having.
A little background...
For styling purposes, there are certain elements on the content area
with custom codes/data attributes hard-coded in Text editor by me. I
primarily work with Foundation framework (by Zurb) and if you're not
familiar, in the markup there are html attributes like 'data-tabs' or
'data-accordions' that enable certain stylistic components on the
front-end.
I also put a lot of effort in accessibility so there are
many instances where I add ARIA attributes wherever necessary.
My client deals with some educational analytical data, so there are some iframes embedded in the content area.
Problem arises when my client tries to edit text contents in the Visual Editor and the editor strips any custom code I put in, data attributes and outright deletes iframe altogether.
Here's what I've done so far:
Even before handing off the project monthes ago, I had added 'valid_elements',
'extended_valid_elements' rule set in the WordPress filter 'tiny_mce_before_init' to allow any kind of attributes/data sets I want
Ever since the issue has been reported, I added ARIA attribute specifically just to make sure that it's not being removed
For iframes being removed, I added extra rule that specifies iframe as a valid children of any container, and iframe can have all the necessary attributes it comes with
Switching back and forth between Visual and Text editor (at least on my environment), saving progress on both Visual/Text while editing content on the other sides, autosaving/drafting/forcing it to close and using browser backups did not cause codes/attributes/iframe to disappear so far (before handing the project to the client and after my client reported the issue).
I've tested with Chrome, Firefox, Internet Explorer, Safari, and Opera on both iOS and Windows environment
I asked my client what their work environment is like, and my client is using Mac, and according to my client, there is no browser extentions like adblock or script block installed on Firefox/Safari
This is what I added in the filter before my client even reported having the problem:
$opts = '*[*]';
$initArray['valid_elements'] = $opts;
$initArray['extended_valid_elements'] = $opts;
I added extra and modified the rules since, and this is what I have right now (in functions.php):
$initArray['valid_elements'] = $opts. ',#[role|aria-hidden|aria-checked|aria-selected|aria-pressed|aria-label|aria-labelledby|aria-disabled|aria-grabbed|aria-controls|aria-describedby|aria-required|tabindex|class|style|data-tabs|data-tabs-content|data-equalizer|data-equalizer-watch|data-equalize-on|data-count|data-ratio|frameborder|allowFullScreen|allowfullscreen]';
$initArray['extended_valid_elements'] = 'iframe[title|class|type|width|height|src|frameborder|allowFullScreen|allowfullscreen|data-ratio]';
$initArray['valid_children'] = '+p[iframe],+div[iframe]';
$initArray['invalid_elements'] = '';
I added iframe as valid children, and specifically told TinyMCE that there are no invalid elements.
...And the client is still having the same problem and I need some insight on why this is happening and how to fix this.
Anyone had the similar experience or might have an answer to this issue?
Edit: Currently looking for a plugin-less solution. There is nothing wrong with using a plugin, I suppose, but if it's doable by writing extra bit of code to solve this, then I'd rather not use it.
Edit 2: It seems that iframe being removed is more pressing issue at the moment. Attributes seem to be intact from my client's grasp, for now.
Update: Figured out the issue. It had nothing to do with TinyMCE. One thing I neglected to account for was that the website is a multisite, and that admin account don't actually have 'unfiltered_html' capability. It was something I did not know, and now I know.
WordPress cleans all the content edited in TinyMCE using KSES functions. So, even if you whitelist some tags in TinyMCE settings, on save, WordPress will filter the content using own KSES functions and will remove tags that are not allowed. By default, only administrators can use IFRAME in the content, for other users, it will be stripped on save. Here is the article on manipulating tags that KSES will allow to be used in content: KSES Tricks. Using similar method, you can add IFRAME to allowed tags list for all users.

Liferay 6.1 force any "edit control" to appear in a popup

I'm having issues with the default css and the custom css written by some other company. I'm trying to merge those two but the one affects the other I managed to fix most of the issues but it is really bad written css and very generic.
In order to limit my issues I was thinking to force any type of web-content diplay and porlet edit controls to open into a popup.
Is this possible? google didn't help.
I'm not sure if I'm understunding your problem, but if the CSS is the cause, I suggest you to fix it instead to look forma a trick.
In order to load web content as dialog, you can create CSS for this purpose on a theme or on each content template.

How do I load same css and scripts as dashboard, in my wordpress plugin

I have googled this and looked across this site and for the life of me cannot find an answer,
I am writing a plugin for wordpress and when I log into the dashboard I can see a collapsable div with content all styled nicely.
When I open my plugin page I don't see the same styles even though the page is very basic.
I have copied the code from the dashboard but it seems as though some of the styles are missing.
I do not need to add custom styles or scripts I just want to load the same css as the dashboard page.
Can anyone tell me where I am going wrong? I assume that the plugin page will adopt the standard admin css, is this assumption wrong?
You don't have to load anything extra for this, just use the correct classes.
You can either look these up in the source, or by using resources as this:
http://www.onextrapixel.com/2009/07/01/how-to-design-and-style-your-wordpress-plugin-admin-panel/

Customize CSS for Facebook Social Plugins

Facebook has these social plugins:
http://developers.facebook.com/docs/plugins/
that can be plugged into a website very easily. They offer limited customization options, and I was wondering if it is possible to change the default CSS to allow custom fonts and colors, re-size images and re-arrange the placement of the buttons or comment.
The particular plugin that I'm looking at is the comments plug in.
Any help or reference that can help me out is greatly appreciated.
Using javascript, YES you can.
give the iframe a name and using prototype framework it can be done like this
frame1.$('mydiv').style.border='1px solid #000000'
and so on. It is possible with any framework.
Make sure you load this javascript after everything is loaded.
Try adding it just before the </body> ....
You're changing the style locally, not on the remote server. In other words, your browser retrieves the vanilla content from facebook and then the JS does it's work inside your browser w/o FB knowing about it... (might be counter-EULA?)

Resources