Dear all,
Given the requirements:

1) A few of my friends would like to log into WordPress account, update our entries.
2) The website that we set up, would automatically retrieve the latest entry on its own and be viewed by the visitors.

What are the things I need to do on the WordPress side? We got a mySQL server though.

Thanks in advance.:)

Dani AI

Generated

Context from the thread: wants friends to log into WordPress to update entries and have a separate, hosted site automatically show the latest entry. suggested a syndication route and reported a WordPress.com account issue — those points affect which approach is best.

Two practical approaches depending on hosting

  • Self-hosted WordPress on the MySQL server: install WordPress, create user accounts and assign roles (Contributor/Author/Editor) so friends can post. Use the WordPress REST API to fetch the latest published post(s). The REST API is built into modern WordPress; see the WordPress REST API docs (https://developer.wordpress.org/rest-api/).
  • WordPress.com-hosted blogs: public content can be read via the WordPress.com API, but plugin/install freedom is limited; see WordPress.com API docs (https://developer.wordpress.com/docs/api/).

Example (fetch latest published post via REST API in PHP)

<?php
$json = file_get_contents('https://example.com/wp-json/wp/v2/posts?per_page=1&status=publish');
$posts = json_decode($json, true);
echo $posts[0]['title']['rendered'];
echo $posts[0]['content']['rendered'];
?>

Direct database access is possible (example SQL), but is fragile and less secure:

SELECT post_title, post_content, post_date
FROM wp_posts
WHERE post_status='publish' AND post_type='post'
ORDER BY post_date DESC
LIMIT 1;

Cautions and best practices: prefer the REST API over direct DB reads (schema and serialization caveats; see the WP database description ). Use HTTPS, cache fetched content (5–15 minutes TTL), sanitize or trust incoming HTML carefully, and use Application Passwords or proper auth when reading non-public content (see REST API authentication docs: https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/).

Recommended Answers

All 3 Replies

hey thanks, will try that out!

wordpress cancelled my account for some violation i dunno..
its sad coz i got lots of blogs there... and the page has a lot of hits.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.