Post Pin

How to Mass Delete Pending Comments in WordPress

  [0]
  - Subscribe by Email or by RSS feed

How to Mass Delete Pending Comments in WordPress. There are 2 practical ways. One for the technically inclined and one for non-tech savvy users who simply want to get rid of thousands of spam pending comments in 1 go. Let us check out both solutions.

For the general user => How to Mass Delete Pending Comments in WordPress using a Plugin

It’s as simple as that. Here are the steps:

  1. Go to your WP dashboard.
  2. Click on “Add New” under Plugins and enter “WP Optimize” in the search box.
  3. Install the WP-Optimize plugin and you’re all set!

Just play around with the plugin and you should be able to find your way around and delete all those pesky spam comments.

For the techie people => How to Mass Delete Pending Comments in WordPress via PHPMyAdmin

Taking this route has its advantages however small. One advantage is less overhead during WP loading but which has very minimal to no visual effect on users. But then again it’s your choice :) Here’s what you have to do:

  1. Enter your CPanel and click on PHPMyAdmin
  2. Select the database of your WP installation
  3. Click on the SQL tab
  4. Enter this code inside the SQL textbox:

That’s it folks! Thanks for reading.

Post Pin

How to Fix Simple HTML Dom Memory Exhaustion Problem

  [0]
  - Subscribe by Email or by RSS feed

How to Fix Simple HTML Dom Memory Exhaustion Problem. Have you encountered an error such as this when trying to use the Simple HTML Dom script?

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 24 bytes) in /home2/asdasd/public_html/labs/lib/simple_html_dom.php on line 750

If yes, then you’ve got yourself a memory exhaustion problem! The Simple HTML Dom script is a very cool script to parse HTML documents but in terms of memory management it is not that cool. Fortunately, there is a simple solution to this problem. Simply allocate more memory dynamically! Add this line of code at the top of your PHP script:

ini_set(“memory_limit”,”200M”);

The “200M” is variable so change it to whatever suits your needs. I believe by default, PHP allocates 64M as the memory limit.

Check out the ff links for more information on this:

  • http://www.php.net/manual/en/ini.core.php#ini.memory-limit
  • http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes

Post Pin

How to Recover Hacked WordPress Login

  [3]
  - Subscribe by Email or by RSS feed

How to Recover Hacked WordPress Login. Believe it or not this site was hacked and was fixed just a few moments ago. I am not sure how long it was hacked but I was able to fix it after a few minutes. Here is what happened.

I logged in to the WP-ADMIN page to login but was not able to do so. My admin account was gone and when I tried to use the password recovery function, it says that there was no such username or email address! So how did I fix this? Easy.

Given that I have some technical background on WordPress installations and MySQL, I used this to my advantage by checking out the WP database to check if my user account still exists. Unsurprisingly, my user account/admin account no longer existed but was replaced by some mysterious login. Hence, what I did was just edit this mysterious account and replaced the information with my own details. After that, I used the WP password recovery to reset my password and then I took this opportunity to upgrade to the latest WP version with the hopes of better security.

If you are not able to follow the vague summary above, here is the step by step walk through for recovering your hacked WP account:

  1. Enter your host CPANEL and click on phpMyAdmin.
  2. Once inside phpMyAdmin, select your blog’s database on the left.
  3. Browse the wp_users table.
  4. Find the hacked row and edit it.
  5. Modify the user_pass column by a) selecting MD5 from the Function drop-down box and b) entering a new password in the Value text box.
  6. Click/Press Go/Save to save your changes.
  7. Create a new tab in your browser and go to your blog’s WP-ADMIN page.
  8. Use the password recovery functionality to reset your password.
  9. OPTIONAL BUT RECOMMENDED. Once your password has been reset and you are able to login once again, upgrade your WP installation into the latest version.

That’s it! If you have the same problem as I did a few moments ago, then just follow the steps above to fix the problem. If you are a programmer or a web developer, you should not have any problems following the instructions. Otherwise, just leave a comment below and I will try to help you the best I can.

Post Pin

How to Execute PHP Code in Your WP Posts

  [2]
  - Subscribe by Email or by RSS feed

Are you stuck with static content in your WordPress posts? Fear no more! I have found a very cool plug-in that lets you use php code in your posts. Check out:

Bluesome

This plug-in is a very well documented plug-in that allows you to use php code in your posts and pages so that you can further customize your static content or display dynamic content (eg. from already available WP built-in functions, etc…).

Try it and see how it goes.

Post Pin

Java Programming with Passion Answers Revealed!

  [3]
  - Subscribe by Email or by RSS feed

I’ve been taking up Sang Shin’s Java Programming with Passion course as a refresher for me (since I’ve already learned Java in college but forgot almost everything XD). It is a very very good refresher course and though I have almost forgotten everything that I have learned before, it’s all coming back to me now (is that a song?). So if you are interested in Java and want to learn or you already know Java but want to do some refreshing, this is the course I would strongly suggest you take.

As all things, we learn by practicing. And as the saying goes, practice makes perfect. The course mentioned above has exercises and homeworks to be done. Do it and I guarantee you that in no time, Java would like be drinking water to you. Anyway, since I have already finished some of the homeworks, I will be posting the answers here. This is not to let you ‘cheat’ but to guide you once got lost and have trouble coming back to the right track.

Home work1001:

Getting to know your Java programming environment

Homework1002:

Java programming basics

Homework1004:

Getting input from keyboard

Homework1034:

Control Structure

Homework1036:

Java Array

Homework1038:

Command-line arguments

Homework1011:

Working with built-in Java classes

Homework1010:

Tour of java.lang.* and java.util.* classes

Once I finish the other exercises, I’ll post them here. If you find anything wrong or incorrect with the code, please let me know. Thanks.