Category Archives: wordpress


Increase php memory limit for wordpress

The Problem:

If your a blogger and using wordpress on a daily basis you may have run into a virtual brick wall when you saw
“Fatal Error : Memory Size Exhausted”
… or some variation of it!

The Reason:

This is generally caused by you host limiting the default memory usage for php sites. If you have several plugins running, you may get errors when trying to access a widget or in the case of using the ‘Next Gen Gallery’ you may have thumbnail fail to update or display properly.

Increasing the php memory limit will fix nextgen gallery issues!

What it will help:
  • Time out errors when accessing widgets
  • Errors generating thumbnails for galleries
  • Failure to upload images
  • Failure to install plug ins
The Solution: Increase php memory limit

In your .htaccess file (you can access it via ftp) add the following code above everything else:

php_value memory_limit 64M
Alternate Solution:

If you can’t get to your .htaccess file, open up your wp-config.php file (usually on the root of your wordress site) and add the following code as the first line:

define('WP_MEMORY_LIMIT', '64M');

[sws_divider_padding]Some hosting companies will also limit the file upload sizes to 2mb. Generally this is not an issue for most simple blog sites. But when you have a client who needs to upload videos or floor plans averaging around 8mb, this can be an problem!

Rather than explaining how to ftp to your client, add the following code to your .htacces file above everything else:

php_value upload_max_filesize 64M

Now you should be able to work just fine. If you need more memory just increase the numbers above. All hosts have a limit so be aware that increasing the numbers will not guarantee more memory!

Remove WordPress 3.1 Admin Bar

When setting up wordpress sites for our clients, we don’t always want them to have access to certain areas of the back-end, such as the widgets. Allowing inexperienced users widget access can destroy all of our hard work. With the help of various plugins we can limit “editor” level access to our admin area!

This was a perfect solution until WordPress v.3.1!

One of the cool new features (for some) of WordPress v3.1 is the addition of the front end admin bar.

When you are the only Administrator for your site, this makes editing the site a little easier. (I still prefer to get right in the back end).

Although this bar can be toggled on and off via your “user profile” page as seen below…

This only works on a per user basis!

So now you’re wondering how to…

Turn off the admin bar for anyone who is not a site admin!

Simply add the following code you your functions.php file

//remove wp admin bar for everyone except ADMIN
function theR3AP3R_function_admin_bar($content) {
return ( current_user_can("administrator") ) ? $content : false;
add_filter( 'show_admin_bar' , 'theR3AP3R_function_admin_bar');

This will allow only the site admins to see the admin bar on the site!