Category Archives: WordPress

How To Convert WordPress Post Title To Url

I would like to know how to convert a post title (or string) to url

You can use wordpress function sanitize_title. When you pass the post title or string, the function will return sanitized string.

To create the file name portion of a URL the same way that WordPress does use this:

$newurl = sanitize_title('How To Convert WordPress Post Title To Url');
echo $newurl;

WordPress XML-RPC Brute Force Attacks With Multiple Logins

Recently, my WordPress site was attacked by XML-RPC Brute Force, I would like how to protect this kind of attack or any patch I can install

Brute Force attacks are one of the oldest and most common types of attacks. In fact, Brute Force attacks against any CMS. XML-RPC is a simple, portable way to make remote procedure calls over HTTP. It can be used with Perl, Java, Python, C, C++, PHP and many other programming languages. WordPress, Drupal and most content management systems support XML-RPC. One of the hidden features of XML-RPC is that you can use the system.multicall method to execute multiple methods inside a single request. So the attackers could try thousands of passwords with only 3 or 4 HTTP requests.

You can do following methods to protect your site.

1. If you have a dedicated server, you can install OSSEC
2. If you dont need XML-RPC, you can block all access to xmlrpc.php
3. If you can’t block XML-RPC, you can block system.multicall requests only

Remove “You may use these HTML tags…” from WordPress Comments

I would like to remove the text under the WordPress comments area ‘you may use these HTML tags and attributes: <a href=”” title=””> <abbr title=””> <acronym title=””> <b>
<blockquote cite=””> <cite> ` <del datetime=””> <i> <q cite=””> <strike>’

The simplest way is controlled by CSS.
Insert the following codes into your WordPress theme style sheet file.

.form-allowed-tags{
    display:none;
}

If you want to remove it permanently rather than just hide it, you need to insert the following codes into your functions.php file from your WordPress theme folder

add_filter( 'comment_form_defaults', 'remove_comment_form_allowed_tags' );
function remove_comment_form_allowed_tags( $defaults ) {

	$defaults['comment_notes_after'] = '';
	return $defaults;

}

How To Fix WordPress Login Problem ?

Not sure whats going on, I cant login wordPress admin suddenly. Some sort of issues like keep refreshing or redirecting

This kind of the issue can be fixed by following way.

1.Disable Plugins to Resolve Login Issues

Some WordPress Plugins may disturb the login process. Disable all of WordPress Plugins, either through the admin panel or by removing them from the /wp-content/plugins/ folder. Once all plugins were disabled, try login again.

2.Deactivate Theme to Resolve Login Issues

Rename the active theme folder (in wp-content/themes) via FTP/Cpanel. Once renamed, try login, if finally logged in, change to a different theme.

3. Clear Cookies to Resolve Login Issues

WordPress uses cookies for login authentication, Co clear your browser cookies , cache and make sure that your browser has cookies enabled. After doing that restart your browser and then try to login.

4. Delete .htaccess File To Resolve Login Refreshing Issues

Sometimes .htaccess file can get corrupted and result in internal server issues or login page refreshing issue. Try login after rename your .htaccess file via FTP/Cpanel.

5.Update Site URL To Resolve Login Redirecting Issues

Editing your WordPress’s wp-config.php and add following two lines of code.
P.S replace with your domain

define('WP_HOME','http://softwarehtec.com');
define('WP_SITEURL','http://softwarehtec.com');

How To Reset WordPress Password Via FTP

How to reset WordPress password, if Lost your password is not working

If you’re using the default admin user of your WordPress site you can reset your password via FTP.

  1. Access your site via FTP and edit your activated theme’s functions.php file
  2. At the beginning after the opening <?php line, add the following:
    wp_set_password( 'password', 1 );

    In this command, the 1 is the user ID of your WordPress site, and password should be changed to your desired password.

  3. Save and upload this file to your WordPress site.
  4. After logging in, go back to the functions.php file of your activated theme and remove the code you just entered because it will reset your password every time the user logs in.

My WordPress Site Only Print Error Establishing Database Connection

My WordPress site only print the message “Error Establishing Database Connection”. How to solve this issue?

“Error establishing a database connection” is usually caused by an error in your WordPress Site wp-config.php file. Access your WordPress site in your FTP client. Open up wp-config.php and ensure that the following are correct:

Database name
Database username
Database password
Database host

WordPress Memory Exhausted Error – Increase PHP Memory

when activated a new plugin from WordPress backend, I got memory exhausted error – Increase PHP Memory like Fatal error: Allowed memory size of 33563442 bytes exhausted (tried to allocate 2128511 bytes)

This error occurs when a WordPress script or a plugin exhausts the default allocated memory size limit.

irst open your wp-config.php of your WordPress site which is located in the root WordPress directory. Then add the following line inside the main php tag:

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

Now we increased the memory limit to 128M. If you still get the error after added codes, then please contact your host. Most likely, would have to go in their php.ini file to increase the memory limit for you. if you are allowed to modify php.ini by yourself, just add the following line

memory_limit = 128M ;

Why My WordPress Site’s URLs Are Ugly

Why my WordPress site’s URLs are ugly, how to make them SEO friendly

By default the default setting of WordPress url structure isn’t very “pretty” much less SEO-Friendly. So if your urls aren’t looking that great (lik softwarehtec.com/?p=1) then simply go to Settings->Permalinks from WordPress admin panel and set your WordPress options to look as follows (or choose the one that best works for you):
Settings -> Permalinks
wordpress-seo-url-options

Why WordPress Site Is So Slow

For the past 2 weeks, our WordPress site have been horribly slow. How can I improve the site and make the site little bit fast

Every time a visitor goes to WordPress site, the server processes PHP scripts and establishes a database connection—in other words, it’s doing a lot of work. The busier your site is, the slower this process becomes.

Slow page loads are problematic as they discourage visitors from visiting WordPress site. The usual culprits are improperly configured or misbehaving plugins or using images that are hosted on other, slower servers.

  • Considering plug-ins like – WP-Super-Cache
  • Replacing external images with images uploaded to your WordPress site
  • Disabling all of your plugins and enable them one by one to determine which plugin causes the slowing.