Wordpress DB structure - php

I want to create more pages in wordpress via running a script. I am new in wordpress and did not understand the wordpress db structure properly. Where I put the page name, link, image and other details?
Can u please tell me the db structure of wordpress?
Thanks in advance

The complete wordpress database structure here
page,link,image all or must be in posts table.

You can find that in wp_posts table. You should find it in the database you create it to install the WP for the first time.

Everything you need to know is here:
https://codex.wordpress.org/Database_Description
It even has links to old versions.
depending on what you might want to add you may have to add things to wp_posts and wp_postmeta, and possibly the taxonomy tables.

Related

Migrating Large PHP Website to Wordpress

I used to have a Wordpress website a few years ago. After getting hacked, I decided to create my own PHP script and extract the necessary data from my Wordpress Installation and keep the same URL structure. Now, a few years later, I want to move back to Wordpress for various reasons. My site has over 2500 articles, and manually importing these articles will be a pain, and I want to keep the same URL structure, as to not lose any SEO.
Here is my SEO structure
https://www.example.com/post-id/post-title-all-lower-case/
I have a database with the following values:
post id
post url (the url slug)
category id
post title
post content
etc..
I can easily create an xml or rss feed with these values for the 2500 posts. But I don't know how to import this content to wordpress. Anyone got any ideas on how I can go through a smooth transition?
I just need this content imported. Creating the theme and everything else is the easy part.
All help is greatly appreciated!
EDIT: SOME PROGRESS!
I have uploaded all my content to a new wordpress installation. Each post has a custom field with a unique number. This number MUST be the post_id.
How do I make it so that I make this custom field the post_id of that post?
All help is greatly appreciated!
You can use this wordpress plugin for safe migration.
https://wordpress.org/plugins/duplicator/
I did something like this a couple of years ago, using MS Excel to concatenate the cells to export to a csv file we could load directly to the mysql db using PHPMyAdmin. We were also doing categories, which involved various tables. For posts, I think you can load directly to the wp_posts db table. I'd create a single post in WP, look to see what table counts change. The look at the tables that changed to see how you would need to populate a csv file to load your content.

How to keep two wordpress blogs under the same site?

I am working on a blog in the media front. I want to create two blogs under the same wordpress site in such a way that the session and the user base is common for the both and i even want to have the same url for both that is
www.example.com
for both. So is there a possibility to do that and as of now i have created two separate blogs under the same database but the issue is the session is separate for both and even the user base and even the url changes. So can someone help out with this. All i need is a little guidance and i can build upon it.
thanks
If you want two WordPress blog and one database for the user. You need to add following code into your both wp_config.php
define(CUSTOM_USER_TABLE,'wp_users');
define(CUSTOM_USER_META_TABLE,'wp_usermeta');
Also you need to Replace the wp_ with the prefix to what you want. You may see https://wordpress.org/support/topic/two-blogs-working-from-one-user-database for more help.

How to migrate the posts from an old custom legacy blog to a new WordPress website?

I have to migrate the posts of a very old custom legacy blog made in ASP (the posts are stored in a MySql table) into a new WordPress blog.
So I need your help to find the smartest solution to do it, I rule out the idea of ​​doing it manually because the number of posts that should be migrated is really high.
So looking this ER schema: http://codex.wordpress.org/images/9/97/WP3.8-ERD.png
I thought I could create a script that take a post from the post table of my old legacy blog and create a new record on the wp_posts wordpress post table of the new blog.
Is it a good solution or exist something better? A WP plugin on something like this?
Tnx
It is better to take advantage of the WordPress Codex rather than importing directly into the tables. This will ensure that the IDs/relationships are generated correctly and that data is serialized as needed to the various tables. If you don't want to write custom code, the easiest way to do this would be to use a CSV import plugin - there are several in the WordPress Plugin Repository - but no particular recommendations.

Wordpress plugin to automate posts being generated based on backend tables?

I am a long time Wordpress user looking to use the tool as a CMS to generate a website which will have individual posts about hundreds of specs on products that I have stored in a backend MySQL table. Is there a plugin or a tool that will help me auto generate these posts? For each post, I would like it to have the same format of title (one column) so that the URL will look like: http://www.domain.com/product1specs etc. Each post will contain a description (another column) and show a graph (data stored in another column).
Or do I even need to create posts? Is there a way to do this dynamically? So if someone goes to www.domain.com/product1 than it will automatically look in the database to find out what it should display for product1?
I believe there are other ways to do this with an PHP framework such as Code Igniter but I would like to stick with Wordpress because I am familiar with it and have other Wordpress plugins/themes I would like to leverage.
Any tips would be greatly appreciated!
I don't know of a plugin but take a look at this answer which basically required the same thing:
How to migrate from Yii to Woocommerce Wp, Still keep to old database (table,rows)

Custom Wordpress Tag Cloud

I'm pretty new to Wordpress and I need your help.
I use WP-Polls plugin and I want to build a tag cloud for it. It would show most popular polls. I'm wondering how I can do that. I've tried creating my own taxonomy but with no luck. I'm not sure if I understand it correctly but Wordpress allows to create taxonomies for wp_posts table only. Is it correct?
Do you have any idea how I could solve the problem?
Thanks a lot!
It can be done using wp_generate_tag_cloud. I have created a plugin that retrieves all the info from db and pass it to the above mentioned function.

Categories