Wordpress

Improve wordpress performance mobile devices logged in user

Improve wordpress performance mobile devices logged in user

In working with a client on performance issues with their wordpress powered website on iPads they were using to beta test, one strange thing became apparent, there was some correlation to a user being logged into the site and the page being choppy and not smooth when the user was not logged in.  Keep reading below to learn what we did to improve wordpress performance mobile devices logged in user.

The page in question was a fairly large page with a jquery table being loaded with about 100 rows of data displayed in page.  Initially my thought was the performance issue was simply due to the size of the page or the lack of performance on the older iPad.  When the page was loaded on a workstation, the page scrolled fine and performance was as expected.  However, even on the iPad when I logged the user off who was logged into the site, performance came right back to par with the desktop.

In noticing what was going on, my hunch was that the admin bar which is displayed by default at the top of the browser window when a user logs in might be the culprit.  So in searching around the wordpress forums I saw the snippet of code to disable the admin bar completely using a filter.  See the code below:

/**Remove Admin Bar */
add_filter( 'show_admin_bar', '__return_false' );

Simply place the above code in your functions.php to effectively disable the bar from being displayed at the top of your browser.  In testing after the bar was removed, there was an IMMEDIATE improvement.  In fact the performance went back to what I was seeing without the user logged in which led me to conclude in this case that the admin bar was to blame.

Final Thoughts

If you have a situation where you are troubleshooting chopping page loading or scrolling behavior for logged in users, give the admin bar filter a shot.  As we saw in this case, the bar can adversely affect performance when it is displayed at the top of the browser along with the page content especially for mobile devices.

Subscribe to VirtualizationHowto via Email 🔔

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com and has over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, Brandon has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.