eppiq Marketing

How to show user login times for WordPress site without plugin using MySQL

There are many plugins available that will give you the last login time for users, but what if you just want to run a quick script to see user activity on your site?

If you have access to the cPanel of your website, you may also have access to the phpMyAdmin, open up a SQL Editor tab.

Paste this into the SQL Editor and click Go

SELECT user_id, wp_users.user_login,
FROM_UNIXTIME(substring_index(substring_index(meta_value, ‘”login”;i:’, -1), ‘;}}’, 1)) as last_login
FROM wp_usermeta
inner join wp_users on user_id = wp_users.ID
WHERE meta_key=’session_tokens’

You may need to change the table names from wp_ to wpXXX_ where XXX is the secure part of your database schema.

I hope this helps!

 

Don't miss these blogs too!

The latest updates, ideas and industry news from the marketing world.

Enhance your SEO Strategy with our Keyword Analyser Tool

Are you looking to enhance your website’s SEO and content strategy? Our FREE Website Keyword Analyser is a tool worth exploring. Unlock the Power of Keyword Insights We’re offering a...

Why offline marketing is still relevant in 2025

In a world dominated by digital ads, social media campaigns, and search engine optimisation, you might think offline marketing is obsolete. Yet it continues to prove its relevance and importance...

CCS Helps eppiq Marketing Achieve ISO 27001:2022 Certification

We have successfully achieved ISO 27001:2022 certification, a globally recognized standard for information security management. The certification process was expertly guided by CCS using their structured 5-step approach. Additionally, the...

Transform your business with Marketing Automation

In today’s competitive digital landscape, businesses must operate smarter, not harder. Marketing automation is a powerful tool that helps streamline marketing efforts, allowing you to deliver personalised customer experiences while...

Elevate your online presence with SEO

In the digital world, a great website means little if it can’t be found. That’s where SEO (Search Engine Optimization) comes in, and eppiq Marketing is at the forefront of...

Why your business needs a website: the key to growth and success

In today’s digital age, a strong online presence is no longer just an option; it’s a necessity. Your business’s website is the foundation of your online identity, acting as the...