Category: Tech Blog

Reset WordPress Admin password through FTP

Update 2025 – if you know your username, you can set the password to ‘password’ and then log in and reset your password

$username = 'myadminusername'; // Replace with the actual username
$user = get_user_by('login', $username);

if ($user) {
wp_set_password('password', $user->ID); // Set new password
echo "Password reset for user: " . esc_html($user->user_login);
} else {
echo "User not found.";
}

Edit the “functions.php” file (wp-content -> themes -> name-of-current-theme -> functions.php

And add the following code to the beginning of it – before everything else:

<?php   
  wp_set_password('password',1);  
  $user_info = get_userdata(1);  
  echo 'Username: ' . $user_info->user_login . "\n";
?>

Then open your website, and it will show your 1st admin user’s username printed somewhere at the top of your website.

The password for that user account will now be “password”.

Delete the above code from “functions.php”, and login to your admin account, changing your password.

Resetting your password in Joomla

With Joomla, you aren’t that lucky… Joomla is slightly more secure, and quite the bit more annoying. They don’t provide a function to email yourself the password, so you need to edit the database. You can do the following

  1. Login to your MySQL Database using phpMyAdmin
  2. Go to your Joomla Users table, EG: jos_users
  3. Select the record (or table row) for your administrator account (The first admin account, created by default, has an id of 62)
  4. Click on ‘Edit Record’ or ‘Edit Inline’
  5. Select the drop-down “function” of “PASSWORD” on the right
  6. And add 5f4dcc3b5aa765d61d8327deb882cf99 as the new password
  7. Save
  8. Login to your site using the password “password” – site.com/administrator
  9. Then change your password when you login

One wordpress install with two domains pointing to it

There are some wp-config codes you can use to allow any domain to run on your website – but this is a method of adding exactly one specific domain name added on to your site. Multiple domains, one WordPress installation.

Open WP-CONFIG.PHP – and paste this after the line about “table prefix”

$hostname = $_SERVER['SERVER_NAME'];
$hostname = str_replace('http://', '', $hostname);
$hostname = str_replace('https://', '', $hostname);
$hostname = str_replace('www.', '', $hostname);
$hostname = strtolower($hostname);
if(substr($hostname, -1) == '/') {
 $hostname = substr($hostname, 0, -1);
}
if ($hostname == 'pushka.com') {
define('WP_SITEURL', 'https://'.$hostname);
define('WP_HOME', 'https://'.$hostname);
}

Replace “pushka.com” with your website address. This should be the 2nd add on domain (for example, if I wanted the website wordpress.com to appear at the address “pushka.com” also.

About “Envelopery”

I used to use envelopery as an email address and company name (hosting and technology blog) however these have been assimilated into the pushka.com website.

How did the name “Envelopery” come about?

I was sitting in my sister’s room trying to help her think of a unique username for a new gMail account (but as with many other popular services online, all the usernames you would normally think of were taken) – refusing to just add numbers to the end. I was thinking of different ideas, and one thought that came to me, was that eMail is quite like a post office, then thinking “envelope.. envelopery..?” – I was so amused by the word, thinking it was like a new name for a place where envelopes are made – an Envelopery.

Old Website Interface

Free open fonts for web design and graphic design

While watching Google IO 2011, I was surprised why one developer was so excited about Google Webfonts, but now I share his excitement!

The internet really is limited with the selection of fonts… It seems that there are so few fonts that you can expect the different operating systems to all have, and having other fonts embedded into the page seems dirty and perhaps illegal in some cases…

But Google have a huge growing archive of webfonts, that you can use with one line of meta code (and you can download the fonts themselves to use for graphic design), and you can use these open free fonts on your site, works on all browsers, works fast.

A subtle change in fonts on a webpage can really add a new feel to it, and enhance the style of existing websites.

I would love to make a font set one day, maybe it will end up in the Google font archive…